32 #ifndef OOMPH_LINEARISED_AXISYM_NAVIER_STOKES_ELEMENTS_HEADER 33 #define OOMPH_LINEARISED_AXISYM_NAVIER_STOKES_ELEMENTS_HEADER 37 #include <oomph-lib-config.h> 41 #include "../generic/Qelements.h" 42 #include "../generic/fsi.h" 113 virtual int p_local_eqn(
const unsigned &n,
const unsigned &
i)=0;
150 for(
unsigned i=0;
i<3;
i++) { result[
i] = 0.0; }
155 (*Base_flow_u_fct_pt)(time,x,result);
171 for(
unsigned i=0;
i<3;
i++)
174 for(
unsigned j=0;j<2;j++) { result(
i,j) = 0.0; }
180 (*Base_flow_dudx_fct_pt)(time,x,result);
302 const unsigned n_time = time_stepper_pt->
ntstorage();
305 for(
unsigned t=0;
t<n_time;
t++)
327 const unsigned &
i)
const=0;
345 const unsigned nplot = 5;
351 void output(std::ostream &outfile,
const unsigned &nplot);
357 const unsigned nplot = 5;
363 void output(FILE* file_pt,
const unsigned &nplot);
368 void output_veloc(std::ostream &outfile,
const unsigned &nplot,
400 residuals,jacobian,mass_matrix,2);
406 const unsigned &i)
const 409 const unsigned n_node =
nnode();
421 double interpolated_u = 0.0;
424 for(
unsigned l=0;l<n_node;l++)
426 interpolated_u +=
nodal_value(l,u_nodal_index)*psi[l];
429 return(interpolated_u);
435 const unsigned &i)
const 441 Shape psi(n_pressure_nodes);
447 double interpolated_p = 0.0;
450 for(
unsigned l=0;l<n_pressure_nodes;l++)
458 return(interpolated_p);
483 static const unsigned Initial_Nvalue[];
524 P_linearised_axi_nst_internal_index(2)
527 for(
unsigned i=0;
i<2;
i++)
531 P_linearised_axi_nst_internal_index[
i]
543 const unsigned &
i)
const 558 for(
unsigned i=0;
i<2;
i++)
579 void output(std::ostream &outfile,
const unsigned &n_plot)
587 void output(FILE* file_pt,
const unsigned &n_plot)
616 for(
unsigned i=0;
i<9;
i++)
619 dtestdx(
i,0) = dpsidx(
i,0);
620 dtestdx(
i,1) = dpsidx(
i,1);
634 const unsigned &ipt,
Shape &psi,
644 for(
unsigned i=0;
i<9;
i++)
647 dtestdx(
i,0) = dpsidx(
i,0);
648 dtestdx(
i,1) = dpsidx(
i,1);
677 for(
unsigned i=0;
i<3;
i++) { test[
i] = psi[
i]; }
724 static const unsigned Initial_Nvalue[];
730 static const unsigned Pconv[];
766 {
return Initial_Nvalue[n]; }
778 const unsigned &
i)
const 792 for(
unsigned i=0;
i<2;
i++)
812 void output(std::ostream &outfile,
const unsigned &n_plot)
820 void output(FILE* file_pt,
const unsigned &n_plot)
849 for(
unsigned i=0;
i<9;
i++)
852 dtestdx(
i,0) = dpsidx(
i,0);
853 dtestdx(
i,1) = dpsidx(
i,1);
876 for(
unsigned i=0;
i<9;
i++)
879 dtestdx(
i,0) = dpsidx(
i,0);
880 dtestdx(
i,1) = dpsidx(
i,1);
894 double psi1[2], psi2[2];
902 for(
unsigned i=0;
i<2;
i++)
904 for(
unsigned j=0;j<2;j++)
907 psi[2*
i + j] = psi2[
i]*psi1[j];
923 for(
unsigned i=0;
i<4;
i++) { test[
i] = psi[
i]; }
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 ...
double * Re_pt
Pointer to global Reynolds number.
double dshape_and_dtest_eulerian_linearised_axi_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...
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
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_linearised_axi_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...
virtual void fill_in_generic_residual_contribution_linearised_axi_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...
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 * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number) ...
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...
virtual int p_index_linearised_axi_nst(const unsigned &i) const
Which nodal value represents the pressure?
void pshape_linearised_axi_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
double *& re_pt()
Pointer to Reynolds number.
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
virtual double dshape_and_dtest_eulerian_at_knot_linearised_axi_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 strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: where (in that order)
LinearisedAxisymmetricQCrouzeixRaviartElement()
Constructor: there are three internal values for each of the two pressure components.
Vector< unsigned > P_linearised_axi_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.
virtual double p_linearised_axi_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...
double interpolated_p_linearised_axi_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 output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
A general Finite Element class.
LinearisedAxisymmetricNavierStokesEquations()
Constructor: NULL the base flow solution and the derivatives of the base flow function.
virtual int p_index_linearised_axi_nst(const unsigned &i) const
Which nodal value represents the pressure? Overload version in base class which returns static int "P...
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.
unsigned npres_linearised_axi_nst() const
Return number of pressure values corresponding to a single pressure component.
const double & density_ratio() const
Density ratio for element: element's density relative to the viscosity used in the definition of the ...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual Vector and the jacobian matrix. Virtual function can be overloaded by ...
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...
double *& density_ratio_pt()
Pointer to the density ratio.
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.
void(* Base_flow_u_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to base flow solution (velocity components) function.
void pin(const unsigned &i)
Pin the i-th stored variable.
unsigned ndof_types() const
Returns the number of "dof-blocks" that degrees of freedom in this element are sub-divided into: Velo...
unsigned ndof_types() const
The number of "dof-blocks" that degrees of freedom in this element are sub-divided into: Velocity and...
double dshape_and_dtest_eulerian_linearised_axi_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...
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
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...
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
double *& viscosity_ratio_pt()
Pointer to the viscosity ratio.
virtual void pshape_linearised_axi_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
static int Default_Azimuthal_Mode_Number_Value
Static default value for the azimuthal mode number (zero)
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...
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) ...
void pshape_linearised_axi_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
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_and_dtest_eulerian_at_knot_linearised_axi_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 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...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
double du_dt_linearised_axi_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...
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed...
double interpolated_u_linearised_axi_nst(const Vector< double > &s, const unsigned &i) const
Return the i-th component of the FE interpolated velocity u[i] at local coordinate s...
A class that represents a collection of data; each Data object may contain many different individual ...
static int Pressure_not_stored_at_node
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...
void output(FILE *file_pt, 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...
virtual unsigned npres_linearised_axi_nst() const =0
Return the number of pressure degrees of freedom associated with a single pressure component in the e...
void fix_pressure(const unsigned &p_dof, const double &pvalue)
Fix both components of the internal pressure degrees of freedom p_dof to pvalue.
int *& azimuthal_mode_number_pt()
Pointer to azimuthal mode number k in e^ik(theta) decomposition.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all initialised to one)
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element's residual Vector.
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...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
unsigned npres_linearised_axi_nst() const
Return number of pressure values corresponding to a single pressure component.
static double Default_Physical_Constant_Value
const int & azimuthal_mode_number() const
Azimuthal mode number k in e^ik(theta) decomposition.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
virtual unsigned u_index_linearised_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value...
double dshape_and_dtest_eulerian_at_knot_linearised_axi_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 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...
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
LinearisedAxisymmetricQTaylorHoodElement()
Constructor, no internal data points.
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.
int * Azimuthal_Mode_Number_pt
Pointer to azimuthal mode number k in e^ik(theta) decomposition.
void disable_ALE()
Disable ALE, i.e. assert the mesh is not moving – you do this at your own risk!
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...
void fix_pressure(const unsigned &n_p, const double &pvalue)
Fix both components of the pressure at local pressure node n_p to pvalue.
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley 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 ...
const double & viscosity_ratio() const
Viscosity ratio for element: element's viscosity relative to the viscosity used in the definition of ...
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
const double & re() const
Reynolds number.
unsigned nnode() const
Return the number of nodes.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
A class for elements that solve the linearised version of the unsteady Navier–Stokes equations in cy...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
double p_linearised_axi_nst(const unsigned &i_internal, const unsigned &i) const
Return the pressure value i at internal dof i_internal (Discontinous pressure interpolation – no nee...
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
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...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
double p_linearised_axi_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)...
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)