32 #ifndef OOMPH_LINEARISED_NAVIER_STOKES_ELEMENTS_HEADER 33 #define OOMPH_LINEARISED_NAVIER_STOKES_ELEMENTS_HEADER 37 #include <oomph-lib-config.h> 41 #include "../generic/Qelements.h" 42 #include "../generic/fsi.h" 128 virtual int p_local_eqn(
const unsigned &n,
const unsigned &
i)=0;
165 for(
unsigned i=0;
i<DIM;
i++) { result[
i] = 0.0; }
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++) { result(
i,j) = 0.0; }
195 (*Base_flow_dudx_fct_pt)(time,x,result);
203 this->Index_of_eigenvalue+i);
231 Data_number_of_eigenvalue=0;
232 Index_of_eigenvalue=0;
280 &normalisation_el_pt)
286 Data_number_of_eigenvalue=
361 const unsigned n_time = time_stepper_pt->
ntstorage();
364 for(
unsigned t=0;
t<n_time;
t++)
386 const unsigned &
i)
const=0;
413 const unsigned nplot = 5;
419 void output(std::ostream &outfile,
const unsigned &nplot);
425 const unsigned nplot = 5;
431 void output(FILE* file_pt,
const unsigned &nplot);
436 void output_veloc(std::ostream &outfile,
const unsigned &nplot,
474 const unsigned &i)
const 477 const unsigned n_node =
nnode();
489 double interpolated_u = 0.0;
492 for(
unsigned l=0;l<n_node;l++)
494 interpolated_u +=
nodal_value(l,u_nodal_index)*psi[l];
497 return(interpolated_u);
503 const unsigned &i)
const 509 Shape psi(n_pressure_nodes);
515 double interpolated_p = 0.0;
518 for(
unsigned l=0;l<n_pressure_nodes;l++)
526 return(interpolated_p);
551 static const unsigned Initial_Nvalue[];
592 P_linearised_nst_internal_index(2)
596 for(
unsigned i=0;
i<4;
i++)
600 P_linearised_nst_internal_index[
i]
612 const unsigned &
i)
const 621 for(
unsigned i=2;
i<4;
i++)
629 unsigned n_node=this->
nnode();
630 for(
unsigned n=0;n<n_node;n++)
634 for(
unsigned i=0;
i<DIM;++
i)
651 unsigned n_node=this->
nnode();
652 for(
unsigned n=0;n<n_node;n++)
656 for(
unsigned i=0;
i<DIM;++
i)
661 nod_pt->
unpin(2*
i +real_index);
673 unsigned n_node = this->
nnode();
674 for(
unsigned n=0;n<n_node;n++)
679 for(
unsigned i=0;
i<DIM;++
i)
681 for(
unsigned j=0;j<2;++j)
689 for(
unsigned i=0;
i<2;++
i)
691 Data* local_data_pt =
693 Data* norm_local_data_pt =
695 for(
unsigned j=0;j<3;j++)
712 for(
unsigned i=0;
i<2;
i++)
733 void output(std::ostream &outfile,
const unsigned &n_plot)
741 void output(FILE* file_pt,
const unsigned &n_plot)
781 const unsigned &ipt,
Shape &psi,
819 for(
unsigned i=0;
i<3;
i++) { test[
i] = psi[
i]; }
866 static const unsigned Initial_Nvalue[];
872 static const unsigned Pconv[];
908 {
return Initial_Nvalue[n]; }
920 const unsigned &
i)
const 929 OOMPH_CURRENT_FUNCTION,
930 OOMPH_EXCEPTION_LOCATION);
937 OOMPH_CURRENT_FUNCTION,
938 OOMPH_EXCEPTION_LOCATION);
944 OOMPH_CURRENT_FUNCTION,
945 OOMPH_EXCEPTION_LOCATION);
958 for(
unsigned i=0;
i<2;
i++)
978 void output(std::ostream &outfile,
const unsigned &n_plot)
986 void output(FILE* file_pt,
const unsigned &n_plot)
1027 const unsigned &ipt,
1048 double psi1[2], psi2[2];
1056 for(
unsigned i=0;
i<2;
i++)
1058 for(
unsigned j=0;j<2;j++)
1061 psi[2*
i + j] = psi2[
i]*psi1[j];
1077 for(
unsigned i=0;
i<4;
i++) { test[
i] = psi[
i]; }
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 unpin(const unsigned &i)
Unpin the i-th stored variable.
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 ...
int eigenvalue_local_eqn(const unsigned &i)
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...
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...
Data * eigenvalue_data_pt()
Access to Data that contains the traded pressure.
void set_eigenfunction_normalisation_element(LinearisedNavierStokesEigenfunctionNormalisationElement *const &normalisation_el_pt)
the boolean flag check_nodal_data is set to false.
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
double * Lambda_pt
Pointer to eigenvalue.
void pin_pressure_normalisation_dofs()
Pin the normalisation dofs.
LinearisedQTaylorHoodElement()
Constructor, no internal data points.
void pin_all()
Pin all the stored variables.
virtual unsigned required_nvalue(const unsigned &n) const
Number of values that must be stored at local node n by the element. The default is 0...
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 disable_ALE()
Disable ALE, i.e. assert the mesh is not moving – you do this at your own risk!
static int Pressure_not_stored_at_node
unsigned npres_linearised_nst() const
Return number of pressure values corresponding to a single pressure component.
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...
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-...
unsigned Data_number_of_eigenvalue
Index of datum where eigenvalue is stored.
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)...
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number) ...
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...
LinearisedQCrouzeixRaviartElement()
Constructor: there are three internal values for each of the two pressure components.
void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
void unpin_all()
Unpin all the stored variables.
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.
const double & density_ratio() const
Density ratio for element: element's density relative to the viscosity used in the definition of the ...
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.
A general Finite Element class.
double *& omega_pt()
Pointer to frequency.
void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
double *& viscosity_ratio_pt()
Pointer to the viscosity ratio.
void enable_ALE()
(Re-)enable ALE, i.e. take possible mesh motion into account when evaluating the time-derivative. Note: By default, ALE is enabled, at the expense of possibly creating unnecessary work in problems where the mesh is, in fact, stationary.
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...
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.
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual void pin_pressure_normalisation_dofs()=0
Pin the normalisation dofs.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element's residual Vector.
double * Re_pt
Pointer to global Reynolds number.
void pin_pressure_normalisation_dofs()
Pin the normalisation dofs.
const double & lambda() const
Vector< unsigned > P_linearised_nst_internal_index
Internal indices that indicate at which internal data the pressure values are stored. We note that there are two pressure values, corresponding to the functions P^C(r,z,t) and P^S(r,z,t) which multiply the cosine and sine terms respectively.
double *& re_pt()
Pointer to Reynolds number.
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...
void pin(const unsigned &i)
Pin the i-th stored variable.
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
unsigned index_of_eigenvalue()
Return the index of Data object at which the traded pressure is stored.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
unsigned npres_linearised_nst() const
Return number of pressure values corresponding to a single pressure component.
double * Omega_pt
Pointer to frequency.
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all initialised to one)
unsigned Index_of_eigenvalue
void(*&)(const double &time, const Vector< double > &x, Vector< double > &f) base_flow_u_fct_pt()
Access function for the base flow solution pointer.
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...
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...
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.t. global coordinates (r and z) at a given time and Eulerian position.
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 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 nee...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
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...
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
unsigned ndof_types() const
Returns the number of "dof-blocks" that degrees of freedom in this element are sub-divided into: Velo...
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...
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...
A class that represents a collection of data; each Data object may contain many different individual ...
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...
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 strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate, const unsigned &real) const
Strain-rate tensor: where (in that order)
void copy_efunction_to_normalisation()
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
bool is_constrained(const unsigned &i)
Test whether the i-th variable is constrained (1: true; 0: false).
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...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
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...
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
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...
double *& density_ratio_pt()
Pointer to the density ratio.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
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) ...
virtual void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
unsigned ndof_types() const
The number of "dof-blocks" that degrees of freedom in this element are sub-divided into: Velocity and...
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 ...
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...
static double Default_Physical_Constant_Value
virtual void unpin_real_or_imag(const unsigned &real)
LinearisedNavierStokesEquations()
Constructor: NULL the base flow solution and the derivatives of the base flow function.
void(* Base_flow_u_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to base flow solution (velocity components) function.
virtual int p_index_linearised_nst(const unsigned &i) const
Which nodal value represents the pressure?
virtual void unpin_real_or_imag(const unsigned &real)=0
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...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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...
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...
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
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...
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
const double & re() const
Reynolds number.
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 ...
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
A class for elements that solve the linearised version of the unsteady Navier–Stokes equations in cy...
void fix_pressure(const unsigned &n_p, const double &pvalue)
Fix both components of the pressure at local pressure node n_p to pvalue.
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
void unpin_real_or_imag(const unsigned &real_index)
double *& lambda_pt()
Pointer to lambda.
const double & viscosity_ratio() const
Viscosity ratio for element: element's viscosity relative to the viscosity used in the definition of ...
unsigned nnode() const
Return the number of nodes.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
LinearisedNavierStokesEigenfunctionNormalisationElement * normalisation_element_pt()
Pointer to normalisation element.
const double & omega() const
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...
LinearisedNavierStokesEigenfunctionNormalisationElement * Normalisation_element_pt
Pointer to the normalisation element.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...
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...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
void fix_pressure(const unsigned &p_dof, const double &pvalue)
Fix both components of the internal pressure degrees of freedom p_dof to pvalue.
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed...
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...
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...
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...
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...
void shape< 2 >(const double &s, double *Psi)
1D shape functions specialised to linear order (2 Nodes)