36 template<
unsigned DIM>
44 template<
unsigned DIM>
50 template<
unsigned DIM>
51 double SpaceTimeNavierStokesMixedOrderEquations<
52 DIM>::Default_Physical_Constant_Value = 0.0;
55 template<
unsigned DIM>
56 double SpaceTimeNavierStokesMixedOrderEquations<
57 DIM>::Default_Physical_Ratio_Value = 1.0;
60 template<
unsigned DIM>
61 Vector<double> SpaceTimeNavierStokesMixedOrderEquations<
62 DIM>::Default_Gravity_vector(DIM, 0.0);
70 template<
unsigned DIM>
104 for (
unsigned i = 0;
i <
DIM;
i++)
114 unsigned n_pres = npres_nst();
135 for (
unsigned i = 0;
i <
DIM + 1;
i++)
154 for (
unsigned i = 0;
i <
DIM;
i++)
196 template<
unsigned DIM>
201 norm.resize(
DIM + 1, 0.0);
213 for (
unsigned i = 0;
i <
DIM + 1;
i++)
228 for (
unsigned i = 0;
i <
DIM;
i++)
231 norm[
i] +=
pow(interpolated_u_nst(
s,
i), 2) * W;
235 norm[
DIM] +=
pow(interpolated_p_nst(
s), 2) * W;
245 template<
unsigned DIM>
278 for (
unsigned i = 0;
i <
DIM + 1;
i++)
284 for (
unsigned i = 0;
i <
DIM;
i++)
306 for (
unsigned i = 0;
i <
DIM;
i++)
343 for (
unsigned i = 0;
i <
DIM;
i++)
356 for (
unsigned i = 0;
i <
DIM;
i++)
366 for (
unsigned i = 0;
i <
DIM;
i++)
389 template<
unsigned DIM>
401 norm.resize(
DIM + 1, 0.0);
422 for (
unsigned i = 0;
i <
DIM + 1;
i++)
428 for (
unsigned i = 0;
i <
DIM;
i++)
450 for (
unsigned i = 0;
i <
DIM;
i++)
487 for (
unsigned i = 0;
i <
DIM;
i++)
500 for (
unsigned i = 0;
i <
DIM;
i++)
510 for (
unsigned i = 0;
i <
DIM;
i++)
533 template<
unsigned DIM>
565 for (
unsigned i = 0;
i <
DIM + 1;
i++)
571 for (
unsigned i = 0;
i <
DIM;
i++)
593 for (
unsigned i = 0;
i <
DIM;
i++)
609 template<
unsigned DIM>
637 for (
unsigned i = 0;
i <
DIM + 1;
i++)
643 for (
unsigned i = 0;
i <
DIM;
i++)
662 for (
unsigned i = 0;
i <
DIM;
i++)
679 template<
unsigned DIM>
705 outfile <<
"ZONE" << std::endl;
714 for (
unsigned i = 0;
i <
DIM + 1;
i++)
720 for (
unsigned i = 0;
i <
DIM;
i++)
742 for (
unsigned i = 0;
i <
DIM;
i++)
752 for (
unsigned i = 0;
i <
DIM;
i++)
762 for (
unsigned i = 0;
i <
DIM;
i++)
779 template<
unsigned DIM>
810 for (
unsigned i = 0;
i <
DIM;
i++)
823 for (
unsigned i = 0;
i <
DIM;
i++)
853 template<
unsigned DIM>
885 for (
unsigned i = 0;
i <
DIM;
i++)
898 for (
unsigned i = 0;
i <
DIM;
i++)
930 template<
unsigned DIM>
956 for (
unsigned i = 0;
i <
DIM + 1;
i++)
963 for (
unsigned i = 0;
i <
DIM;
i++)
966 outfile << interpolated_u_nst(
s,
i) <<
" ";
983 template<
unsigned DIM>
1009 for (
unsigned i = 0;
i <
DIM + 1;
i++)
1016 for (
unsigned i = 0;
i <
DIM;
i++)
1019 outfile << interpolated_u_nst(
s,
i) <<
" ";
1023 outfile << interpolated_p_nst(
s) <<
" ";
1042 template<
unsigned DIM>
1062 for (
unsigned i = 0;
i <
DIM + 1;
i++)
1069 for (
unsigned i = 0;
i <
DIM;
i++)
1092 template<
unsigned DIM>
1144 for (
unsigned i = 0;
i <
DIM;
i++)
1162 for (
unsigned j = 0;
j <
DIM;
j++)
1174 for (
unsigned i = 0;
i <
DIM;
i++)
1180 for (
unsigned k = 0;
k <
DIM;
k++)
1188 for (
unsigned i = 0;
i <
DIM + 1;
i++)
1195 for (
unsigned i = 0;
i <
DIM;
i++)
1198 outfile << interpolated_u_nst(
s,
i) <<
" ";
1202 outfile << interpolated_p_nst(
s) <<
" ";
1205 for (
unsigned i = 0;
i <
DIM;
i++)
1229 template<
unsigned DIM>
1254 std::string error_message =
1255 "Can't output vorticity in 1D - in fact, what ";
1256 error_message +=
"do you mean\nby the 1D Navier-Stokes equations?\n";
1274 for (
unsigned i = 0;
i <
DIM + 1;
i++)
1311 template<
unsigned DIM>
1327 for (
unsigned i = 0;
i <
DIM + 1;
i++)
1349 for (
unsigned i = 0;
i <
DIM;
i++)
1352 for (
unsigned j = 0;
j <
DIM;
j++)
1372 template<
unsigned DIM>
1383 double press = interpolated_p_nst(
s);
1386 for (
unsigned i = 0;
i <
DIM;
i++)
1392 for (
unsigned j = 0;
j <
DIM;
j++)
1406 template<
unsigned DIM>
1424 double press = interpolated_p_nst(
s);
1427 for (
unsigned i = 0;
i <
DIM;
i++)
1433 for (
unsigned j = 0;
j <
DIM;
j++)
1450 template<
unsigned DIM>
1460 for (
unsigned i = 0;
i <
DIM;
i++)
1462 for (
unsigned j = 0;
j <
DIM;
j++)
1474 template<
unsigned DIM>
1481 std::ostringstream error_message;
1482 error_message <<
"The strain rate has incorrect dimensions "
1484 <<
" not " <<
DIM << std::endl;
1506 dudx.initialise(0.0);
1509 for (
unsigned i = 0;
i <
DIM;
i++)
1515 for (
unsigned j = 0;
j <
DIM;
j++)
1527 for (
unsigned i = 0;
i <
DIM;
i++)
1530 for (
unsigned j = 0;
j <
DIM;
j++)
1550 std::ostringstream error_message;
1553 error_message <<
"Computation of vorticity in 2D requires a 1D vector\n"
1554 <<
"which contains the only non-zero component of the\n"
1555 <<
"vorticity vector. You've passed a vector of size "
1583 dudx.initialise(0.0);
1586 for (
unsigned i = 0;
i <
dim;
i++)
1592 for (
unsigned j = 0;
j <
dim;
j++)
1619 get_vorticity(
s,
vort);
1633 template<
unsigned DIM>
1649 for (
unsigned i = 0;
i <
DIM + 1;
i++)
1662 for (
unsigned i = 0;
i <
DIM;
i++)
1678 template<
unsigned DIM>
1695 unsigned u_index[
DIM];
1696 for (
unsigned i = 0;
i <
DIM;
i++)
1698 u_index[
i] = this->u_index_nst(
i);
1718 for (
unsigned i = 0;
i <
DIM;
i++)
1734 for (
unsigned i = 0;
i <
DIM;
i++)
1738 for (
unsigned j = 0;
j <
DIM;
j++)
1740 interpolated_dudx(
i,
j) +=
1747 for (
unsigned i = 0;
i <
DIM;
i++)
1749 for (
unsigned k = 0;
k <
DIM;
k++)
1759 for (
unsigned i = 0;
i <
DIM;
i++)
1775 template<
unsigned DIM>
1792 for (
unsigned i = 0;
i <
DIM + 1;
i++)
1807 double press = interpolated_p_nst(
s);
1822 template<
unsigned DIM>
1827 const unsigned&
flag)
1841 template<
unsigned DIM>
1846 const unsigned&
flag)
1849 if (
ndof() == 0)
return;
1855 unsigned n_pres = npres_nst();
1861 for (
unsigned i = 0;
i <
DIM;
i++)
1895 double scaled_re = re() * density_ratio();
1923 for (
unsigned i = 0;
i <
DIM + 1;
i++)
1933 double J = dshape_and_dtest_eulerian_at_knot_nst(
1946 double interpolated_p = 0.0;
1967 interpolated_p += p_nst(
l) *
psip[
l];
1980 for (
unsigned i = 0;
i <
DIM;
i++)
1995 for (
unsigned j = 0;
j <
DIM;
j++)
2010 for (
unsigned i = 0;
i <
DIM;
i++)
2037 for (
unsigned i = 0;
i <
DIM;
i++)
2062 for (
unsigned k = 0;
k <
DIM;
k++)
2072 for (
unsigned k = 0;
k <
DIM;
k++)
2076 interpolated_dudx(
i,
k) *
testf[
l] * W);
2080 for (
unsigned k = 0;
k <
DIM;
k++)
2087 Gamma[
i] * interpolated_dudx(
k,
i)) *
2141 for (
unsigned k = 0;
k <
DIM;
k++)
2151 for (
unsigned k = 0;
k <
DIM;
k++)
2160 for (
unsigned k = 0;
k <
DIM;
k++)
2192 if (ReynoldsStrouhal_is_stored_as_external_data)
2217 for (
unsigned k = 0;
k <
DIM;
k++)
2222 interpolated_dudx(
i,
k) *
testf[
l] * W);
2248 for (
unsigned k = 0;
k <
DIM;
k++)
2290 template<
unsigned DIM>
2297 const unsigned&
flag)
2309 template<
unsigned DIM>
2329 template<
unsigned DIM>
2335 throw OomphLibError(
"Space-time update needs to be checked!",
2351 {3, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2,
2352 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 3};
2357 0, 2, 6, 8, 18, 20, 24, 26};
2368 template<
unsigned DIM>
2373 unsigned u_index[
DIM];
2376 for (
unsigned i = 0;
i <
DIM;
i++)
2379 u_index[
i] = this->u_index_nst(
i);
2390 for (
unsigned i = 0;
i <
DIM;
i++)
2410 template<
unsigned DIM>
2415 unsigned p_index =
static_cast<unsigned>(this->p_nodal_index_nst());
2418 unsigned n_pres = npres_nst();
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed....
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
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")
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
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 dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
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 double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point.
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"...
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.
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
unsigned ndof() const
Return the number of equations/dofs in the element.
int external_local_eqn(const unsigned &i, const unsigned &j)
Return the local equation number corresponding to the j-th value stored at the i-th external data.
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....
Taylor-Hood elements are Navier-Stokes elements with quadratic interpolation for velocities and posit...
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing.
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
A class for elements that solve the Cartesian Navier-Stokes equations, templated by the dimension DIM...
void fill_in_contribution_to_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Compute the hessian tensor vector products required to perform continuation of bifurcations analytica...
virtual void fill_in_generic_dresidual_contribution_nst(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, const unsigned &flag)
Compute the derivatives of the residuals for the Navier-Stokes equations with respect to a parameter ...
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....
static int Pressure_not_stored_at_node
Static "magic" number that indicates that the pressure is not stored at a node.
double d_kin_energy_dt() const
Get integral of time derivative of kinetic energy over element.
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Output function: x,y,t,u,v in tecplot format. Use n_plot points in each coordinate direction at times...
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....
virtual void fill_in_generic_pressure_advection_diffusion_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp precond...
void get_pressure_and_velocity_mass_matrix_diagonal(Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed,...
virtual void fill_in_generic_residual_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, const unsigned &flag)
Compute the residuals for the Navier-Stokes equations. Flag=1 (or 0): do (or don't) compute the Jacob...
double kin_energy() const
Get integral of kinetic energy over element.
void compute_norm(Vector< double > &norm)
Compute the vector norm of the FEM solution.
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: 1/2 (du_i/dx_j+du_j/dx_i)
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not N.B. This needs to be public so th...
void output_vorticity(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,t,omega in tecplot format. nplot points in each coordinate direction.
double dissipation() const
Return integral of dissipation over element.
void get_vorticity(const Vector< double > &s, Vector< double > &vorticity) const
Compute the vorticity vector at local coordinate s.
void output(std::ostream &outfile)
Output function: x,y,t,u,v,p in tecplot format. The default number of plot points is five.
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
Compute traction (on the viscous scale) exerted onto the fluid at local coordinate s....
double pressure_integral() const
Integral of pressure over element.
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....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).