28 #ifndef OOMPH_LINEARISED_NAVIER_STOKES_ELEMENTS_HEADER
29 #define OOMPH_LINEARISED_NAVIER_STOKES_ELEMENTS_HEADER
33 #include <oomph-lib-config.h>
37 #include "../generic/Qelements.h"
38 #include "../generic/fsi.h"
130 DShape& dtestdx)
const = 0;
140 DShape& dtestdx)
const = 0;
144 Shape& psi)
const = 0;
149 Shape& test)
const = 0;
162 for (
unsigned i = 0;
i < DIM;
i++)
170 (*Base_flow_u_fct_pt)(time, x, result);
186 for (
unsigned i = 0;
i < DIM;
i++)
189 for (
unsigned j = 0; j < DIM; j++)
198 (*Base_flow_dudx_fct_pt)(time, x, result);
206 this->Index_of_eigenvalue +
i);
253 const double&
re()
const
405 for (
unsigned t = 0;
t < n_time;
t++)
434 const unsigned&
i)
const = 0;
457 const unsigned& real)
const;
463 const unsigned nplot = 5;
469 void output(std::ostream& outfile,
const unsigned& nplot);
475 const unsigned nplot = 5;
481 void output(FILE* file_pt,
const unsigned& nplot);
487 const unsigned& nplot,
526 const unsigned&
i)
const
529 const unsigned n_node =
nnode();
541 double interpolated_u = 0.0;
544 for (
unsigned l = 0; l < n_node; l++)
546 interpolated_u +=
nodal_value(l, u_nodal_index) * psi[l];
549 return (interpolated_u);
555 const unsigned&
i)
const
561 Shape psi(n_pressure_nodes);
567 double interpolated_p = 0.0;
570 for (
unsigned l = 0; l < n_pressure_nodes; l++)
578 return (interpolated_p);
649 for (
unsigned i = 0;
i < 4;
i++)
673 for (
unsigned i = 2;
i < 4;
i++)
681 unsigned n_node = this->
nnode();
682 for (
unsigned n = 0; n < n_node; n++)
686 for (
unsigned i = 0;
i < DIM; ++
i)
703 unsigned n_node = this->
nnode();
704 for (
unsigned n = 0; n < n_node; n++)
708 for (
unsigned i = 0;
i < DIM; ++
i)
713 nod_pt->
unpin(2 *
i + real_index);
725 unsigned n_node = this->
nnode();
726 for (
unsigned n = 0; n < n_node; n++)
731 for (
unsigned i = 0;
i < DIM; ++
i)
733 for (
unsigned j = 0; j < 2; ++j)
741 for (
unsigned i = 0;
i < 2; ++
i)
743 Data* local_data_pt =
745 Data* norm_local_data_pt =
747 for (
unsigned j = 0; j < 3; j++)
767 for (
unsigned i = 0;
i < 2;
i++)
789 void output(std::ostream& outfile,
const unsigned& n_plot)
801 void output(FILE* file_pt,
const unsigned& n_plot)
810 return 2 * (DIM + 1);
884 for (
unsigned i = 0;
i < 3;
i++)
985 return (2 * DIM +
i);
999 OOMPH_CURRENT_FUNCTION,
1000 OOMPH_EXCEPTION_LOCATION);
1007 OOMPH_CURRENT_FUNCTION,
1008 OOMPH_EXCEPTION_LOCATION);
1014 OOMPH_CURRENT_FUNCTION,
1015 OOMPH_EXCEPTION_LOCATION);
1031 for (
unsigned i = 0;
i < 2;
i++)
1052 void output(std::ostream& outfile,
const unsigned& n_plot)
1064 void output(FILE* file_pt,
const unsigned& n_plot)
1133 double psi1[2], psi2[2];
1141 for (
unsigned i = 0;
i < 2;
i++)
1143 for (
unsigned j = 0; j < 2; j++)
1146 psi[2 *
i + j] = psi2[
i] * psi1[j];
1161 for (
unsigned i = 0;
i < 4;
i++)
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
A class that represents a collection of data; each Data object may contain many different individual ...
void pin_all()
Pin all the stored variables.
void pin(const unsigned &i)
Pin the i-th stored variable.
void unpin(const unsigned &i)
Unpin the i-th stored variable.
double * value_pt(const unsigned &i) const
Return the pointer to the i-the stored value. Typically this is required when direct access to the st...
void unpin_all()
Unpin all the stored variables.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
bool is_constrained(const unsigned &i)
Test whether the i-th variable is constrained (1: true; 0: false).
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
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 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-...
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...
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.
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...
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data.
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.
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) external data object to the element and return its index (i....
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
A class that is used to implement the constraint that the eigenfunction has a particular normalisatio...
Data * eigenvalue_data_pt()
Access to Data that contains the traded pressure.
unsigned index_of_eigenvalue()
Return the index of Data object at which the traded pressure is stored.
A class for elements that solve the linearised version of the unsteady Navier–Stokes equations in cyl...
LinearisedNavierStokesEquations()
Constructor: NULL the base flow solution and the derivatives of the base flow function.
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,...
double *& re_pt()
Pointer to Reynolds number.
virtual void pshape_linearised_nst(const Vector< double > &s, Shape &psi, Shape &test) const =0
Compute the pressure shape and test functions at local coordinate s.
LinearisedNavierStokesEigenfunctionNormalisationElement * normalisation_element_pt()
Pointer to normalisation element.
virtual void pin_real_or_imag(const unsigned &real)=0
Pin the real or imaginary part of the problem Input integer 0 for real 1 for imaginary.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element's residual Vector.
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...
void output(FILE *file_pt)
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...
void(* Base_flow_dudx_fct_pt)(const double &time, const Vector< double > &x, DenseMatrix< double > &result)
Pointer to derivatives of base flow solution velocity components w.r.t. global coordinates (r and z) ...
const double & re() const
Reynolds number.
unsigned Data_number_of_eigenvalue
Index of datum where eigenvalue is stored.
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....
LinearisedNavierStokesEigenfunctionNormalisationElement * Normalisation_element_pt
Pointer to the normalisation element.
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...
void(*&)(const double &time, const Vector< double > &x, DenseMatrix< double > &f) base_flow_dudx_fct_pt()
Access function for the derivatives of the base flow w.r.t. global coordinates solution pointer.
virtual void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed....
double du_dt_linearised_nst(const unsigned &n, const unsigned &i) const
Return the i-th component of du/dt at local node n. Uses suitably interpolated value for hanging node...
void set_eigenfunction_normalisation_element(LinearisedNavierStokesEigenfunctionNormalisationElement *const &normalisation_el_pt)
the boolean flag check_nodal_data is set to false.
double * Lambda_pt
Pointer to eigenvalue.
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 void pin_pressure_normalisation_dofs()=0
Pin the normalisation dofs.
double *& lambda_pt()
Pointer to lambda.
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)
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
void disable_ALE()
Disable ALE, i.e. assert the mesh is not moving – you do this at your own risk!
void(*&)(const double &time, const Vector< double > &x, Vector< double > &f) base_flow_u_fct_pt()
Access function for the base flow solution pointer.
void(* Base_flow_u_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to base flow solution (velocity components) function.
double *& omega_pt()
Pointer to frequency.
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...
void enable_ALE()
(Re-)enable ALE, i.e. take possible mesh motion into account when evaluating the time-derivative....
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.
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
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....
double * Re_pt
Pointer to global Reynolds number.
double *& viscosity_ratio_pt()
Pointer to the viscosity ratio.
unsigned Index_of_eigenvalue
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
double *& density_ratio_pt()
Pointer to the density ratio.
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number)
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
virtual void unpin_real_or_imag(const unsigned &real)=0
virtual int p_index_linearised_nst(const unsigned &i) const
Which nodal value represents the pressure?
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 ...
double * Omega_pt
Pointer to frequency.
virtual double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and their derivatives w.r.t. global coordinates at local coordinate s....
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
void fix_pressure(const unsigned &p_dof, const double &pvalue)
Fix both components of the internal pressure degrees of freedom p_dof to pvalue.
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
double p_linearised_nst(const unsigned &i_internal, const unsigned &i) const
Return the pressure value i at internal dof i_internal (Discontinous pressure interpolation – no need...
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
LinearisedQCrouzeixRaviartElement()
Constructor: there are three internal values for each of the two pressure components.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
void copy_efunction_to_normalisation()
double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivatives w.r.t. global coordinates at local coordinate...
static const unsigned Initial_Nvalue[]
Static array of ints to hold required number of variables at nodes.
void pin_real_or_imag(const unsigned &real_index)
Pin the real or imaginary part of the problem Input integer 0 for real 1 for imaginary.
unsigned npres_linearised_nst() const
Return number of pressure values corresponding to a single pressure component.
Vector< unsigned > P_linearised_nst_internal_index
Internal indices that indicate at which internal data the pressure values are stored....
void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
int p_local_eqn(const unsigned &n, const unsigned &i)
Overload the access function for the i-th component of the pressure's local equation numbers.
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
void pin_pressure_normalisation_dofs()
Pin the normalisation dofs.
double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivatives w.r.t. global coordinates at the ipt-th integ...
void unpin_real_or_imag(const unsigned &real_index)
unsigned ndof_types() const
The number of "dof-blocks" that degrees of freedom in this element are sub-divided into: Velocity and...
virtual unsigned required_nvalue(const unsigned &n) const
Return number of values (pinned or dofs) required at local node n.
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivatives w.r.t. global coordinates the ipt-th integati...
void fix_pressure(const unsigned &n_p, const double &pvalue)
Fix both components of the pressure at local pressure node n_p to pvalue.
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
void pin_pressure_normalisation_dofs()
Pin the normalisation dofs.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
unsigned ndof_types() const
Returns the number of "dof-blocks" that degrees of freedom in this element are sub-divided into: Velo...
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
unsigned npres_linearised_nst() const
Return number of pressure values corresponding to a single pressure component.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
virtual void pin_real_or_imag(const unsigned &real)
Pin the real or imaginary part of the problem Input integer 0 for real 1 for imaginary.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
virtual int p_index_linearised_nst(const unsigned &i) const
Which nodal value represents the pressure? Overload version in base class which returns static int "P...
double p_linearised_nst(const unsigned &n_p, const unsigned &i) const
Access function for the i-th component of pressure at local pressure node n_p (const version).
LinearisedQTaylorHoodElement()
Constructor, no internal data points.
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at node n. Can be overwritten for hanging node version.
int p_local_eqn(const unsigned &n, const unsigned &i)
Overload the access function for the i-th component of the pressure's local equation numbers.
double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivatives w.r.t. global coordinates at local coordinate...
virtual void unpin_real_or_imag(const unsigned &real)
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
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...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
void shape< 2 >(const double &s, double *Psi)
1D shape functions specialised to linear order (2 Nodes)
//////////////////////////////////////////////////////////////////// ////////////////////////////////...