oomph::LinearisedNavierStokesEquations Class Referenceabstract

#include <linearised_navier_stokes_elements.h>

+ Inheritance diagram for oomph::LinearisedNavierStokesEquations:

Public Member Functions

 LinearisedNavierStokesEquations ()
 
const doublere () const
 Reynolds number. More...
 
const doublere_st () const
 Product of Reynolds and Strouhal number (=Womersley number) More...
 
const doublelambda () const
 
const doubleomega () const
 
double *& re_pt ()
 Pointer to Reynolds number. More...
 
double *& re_st_pt ()
 Pointer to product of Reynolds and Strouhal number (=Womersley number) More...
 
double *& lambda_pt ()
 Pointer to lambda. More...
 
double *& omega_pt ()
 Pointer to frequency. More...
 
LinearisedNavierStokesEigenfunctionNormalisationElementnormalisation_element_pt ()
 Pointer to normalisation element. More...
 
void set_eigenfunction_normalisation_element (LinearisedNavierStokesEigenfunctionNormalisationElement *const &normalisation_el_pt)
 the boolean flag check_nodal_data is set to false. More...
 
const doubleviscosity_ratio () const
 
double *& viscosity_ratio_pt ()
 Pointer to the viscosity ratio. More...
 
const doubledensity_ratio () const
 
double *& density_ratio_pt ()
 Pointer to the density ratio. More...
 
virtual unsigned npres_linearised_nst () const =0
 
virtual unsigned u_index_linearised_nst (const unsigned &i) const
 
double du_dt_linearised_nst (const unsigned &n, const unsigned &i) const
 
void disable_ALE ()
 
void enable_ALE ()
 
virtual double p_linearised_nst (const unsigned &n_p, const unsigned &i) const =0
 
virtual void pin_real_or_imag (const unsigned &real)=0
 
virtual void unpin_real_or_imag (const unsigned &real)=0
 
virtual void pin_pressure_normalisation_dofs ()=0
 Pin the normalisation dofs. More...
 
virtual int p_index_linearised_nst (const unsigned &i) const
 Which nodal value represents the pressure? More...
 
void strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate, const unsigned &real) const
 
void output (std::ostream &outfile)
 
void output (std::ostream &outfile, const unsigned &nplot)
 
void output (FILE *file_pt)
 
void output (FILE *file_pt, const unsigned &nplot)
 
void output_veloc (std::ostream &outfile, const unsigned &nplot, const unsigned &t)
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Compute the element's residual Vector. More...
 
double interpolated_u_linearised_nst (const Vector< double > &s, const unsigned &i) const
 
double interpolated_p_linearised_nst (const Vector< double > &s, const unsigned &i) const
 
- Public Member Functions inherited from oomph::FiniteElement
void set_dimension (const unsigned &dim)
 
void set_nodal_dimension (const unsigned &nodal_dim)
 
void set_nnodal_position_type (const unsigned &nposition_type)
 Set the number of types required to interpolate the coordinate. More...
 
void set_n_node (const unsigned &n)
 
int nodal_local_eqn (const unsigned &n, const unsigned &i) const
 
double dJ_eulerian_at_knot (const unsigned &ipt, Shape &psi, DenseMatrix< double > &djacobian_dX) const
 
 FiniteElement ()
 Constructor. More...
 
virtual ~FiniteElement ()
 
 FiniteElement (const FiniteElement &)=delete
 Broken copy constructor. More...
 
virtual bool local_coord_is_valid (const Vector< double > &s)
 Broken assignment operator. More...
 
virtual void move_local_coord_back_into_element (Vector< double > &s) const
 
void get_centre_of_gravity_and_max_radius_in_terms_of_zeta (Vector< double > &cog, double &max_radius) const
 
virtual void local_coordinate_of_node (const unsigned &j, Vector< double > &s) const
 
virtual void local_fraction_of_node (const unsigned &j, Vector< double > &s_fraction)
 
virtual double local_one_d_fraction_of_node (const unsigned &n1d, const unsigned &i)
 
virtual void set_macro_elem_pt (MacroElement *macro_elem_pt)
 
MacroElementmacro_elem_pt ()
 Access function to pointer to macro element. More...
 
void get_x (const Vector< double > &s, Vector< double > &x) const
 
void get_x (const unsigned &t, const Vector< double > &s, Vector< double > &x)
 
virtual void get_x_from_macro_element (const Vector< double > &s, Vector< double > &x) const
 
virtual void get_x_from_macro_element (const unsigned &t, const Vector< double > &s, Vector< double > &x)
 
virtual void set_integration_scheme (Integral *const &integral_pt)
 Set the spatial integration scheme. More...
 
Integral *const & integral_pt () const
 Return the pointer to the integration scheme (const version) More...
 
virtual void shape (const Vector< double > &s, Shape &psi) const =0
 
virtual void shape_at_knot (const unsigned &ipt, Shape &psi) const
 
virtual void dshape_local (const Vector< double > &s, Shape &psi, DShape &dpsids) const
 
virtual void dshape_local_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsids) const
 
virtual void d2shape_local (const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
 
virtual void d2shape_local_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsids, DShape &d2psids) const
 
virtual double J_eulerian (const Vector< double > &s) const
 
virtual double J_eulerian_at_knot (const unsigned &ipt) const
 
void check_J_eulerian_at_knots (bool &passed) const
 
void check_jacobian (const double &jacobian) const
 
double dshape_eulerian (const Vector< double > &s, Shape &psi, DShape &dpsidx) const
 
virtual double dshape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsidx) const
 
virtual double dshape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsi, DenseMatrix< double > &djacobian_dX, RankFourTensor< double > &d_dpsidx_dX) const
 
double d2shape_eulerian (const Vector< double > &s, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
 
virtual double d2shape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
 
virtual void assign_nodal_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void describe_nodal_local_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void assign_all_generic_local_eqn_numbers (const bool &store_local_dof_pt)
 
Node *& node_pt (const unsigned &n)
 Return a pointer to the local node n. More...
 
Node *const & node_pt (const unsigned &n) const
 Return a pointer to the local node n (const version) More...
 
unsigned nnode () const
 Return the number of nodes. More...
 
virtual unsigned nnode_1d () const
 
double raw_nodal_position (const unsigned &n, const unsigned &i) const
 
double raw_nodal_position (const unsigned &t, const unsigned &n, const unsigned &i) const
 
double raw_dnodal_position_dt (const unsigned &n, const unsigned &i) const
 
double raw_dnodal_position_dt (const unsigned &n, const unsigned &j, const unsigned &i) const
 
double raw_nodal_position_gen (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_nodal_position_gen (const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_dnodal_position_gen_dt (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_dnodal_position_gen_dt (const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double nodal_position (const unsigned &n, const unsigned &i) const
 
double nodal_position (const unsigned &t, const unsigned &n, const unsigned &i) const
 
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. More...
 
double dnodal_position_dt (const unsigned &n, const unsigned &j, const unsigned &i) const
 
double nodal_position_gen (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double nodal_position_gen (const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double dnodal_position_gen_dt (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double dnodal_position_gen_dt (const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
 
virtual void get_dresidual_dnodal_coordinates (RankThreeTensor< double > &dresidual_dnodal_coordinates)
 
virtual unsigned required_nvalue (const unsigned &n) const
 
unsigned nnodal_position_type () const
 
bool has_hanging_nodes () const
 
unsigned nodal_dimension () const
 Return the required Eulerian dimension of the nodes in this element. More...
 
virtual unsigned nvertex_node () const
 
virtual Nodevertex_node_pt (const unsigned &j) const
 
virtual Nodeconstruct_node (const unsigned &n)
 
virtual Nodeconstruct_node (const unsigned &n, TimeStepper *const &time_stepper_pt)
 
virtual Nodeconstruct_boundary_node (const unsigned &n)
 
virtual Nodeconstruct_boundary_node (const unsigned &n, TimeStepper *const &time_stepper_pt)
 
int get_node_number (Node *const &node_pt) const
 
virtual Nodeget_node_at_local_coordinate (const Vector< double > &s) const
 
double raw_nodal_value (const unsigned &n, const unsigned &i) const
 
double raw_nodal_value (const unsigned &t, const unsigned &n, const unsigned &i) const
 
double nodal_value (const unsigned &n, const unsigned &i) const
 
double nodal_value (const unsigned &t, const unsigned &n, const unsigned &i) const
 
unsigned dim () const
 
virtual ElementGeometry::ElementGeometry element_geometry () const
 Return the geometry type of the element (either Q or T usually). More...
 
virtual double interpolated_x (const Vector< double > &s, const unsigned &i) const
 Return FE interpolated coordinate x[i] at local coordinate s. More...
 
virtual double interpolated_x (const unsigned &t, const Vector< double > &s, const unsigned &i) const
 
virtual void interpolated_x (const Vector< double > &s, Vector< double > &x) const
 Return FE interpolated position x[] at local coordinate s as Vector. More...
 
virtual void interpolated_x (const unsigned &t, const Vector< double > &s, Vector< double > &x) const
 
virtual double interpolated_dxdt (const Vector< double > &s, const unsigned &i, const unsigned &t)
 
virtual void interpolated_dxdt (const Vector< double > &s, const unsigned &t, Vector< double > &dxdt)
 
unsigned ngeom_data () const
 
Datageom_data_pt (const unsigned &j)
 
void position (const Vector< double > &zeta, Vector< double > &r) const
 
void position (const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
 
void dposition_dt (const Vector< double > &zeta, const unsigned &t, Vector< double > &drdt)
 
virtual double zeta_nodal (const unsigned &n, const unsigned &k, const unsigned &i) const
 
void interpolated_zeta (const Vector< double > &s, Vector< double > &zeta) const
 
void locate_zeta (const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
 
virtual void node_update ()
 
virtual void identify_field_data_for_interactions (std::set< std::pair< Data *, unsigned >> &paired_field_data)
 
virtual void identify_geometric_data (std::set< Data * > &geometric_data_pt)
 
virtual double s_min () const
 Min value of local coordinate. More...
 
virtual double s_max () const
 Max. value of local coordinate. More...
 
double size () const
 
virtual double compute_physical_size () const
 
virtual void point_output_data (const Vector< double > &s, Vector< double > &data)
 
void point_output (std::ostream &outfile, const Vector< double > &s)
 
virtual unsigned nplot_points_paraview (const unsigned &nplot) const
 
virtual unsigned nsub_elements_paraview (const unsigned &nplot) const
 
void output_paraview (std::ofstream &file_out, const unsigned &nplot) const
 
virtual void write_paraview_output_offset_information (std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
 
virtual void write_paraview_type (std::ofstream &file_out, const unsigned &nplot) const
 
virtual void write_paraview_offsets (std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
 
virtual unsigned nscalar_paraview () const
 
virtual void scalar_value_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
 
virtual void scalar_value_fct_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
 
virtual void scalar_value_fct_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
 
virtual std::string scalar_name_paraview (const unsigned &i) const
 
virtual void output (const unsigned &t, std::ostream &outfile, const unsigned &n_plot) const
 
virtual void output_fct (std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
 Output an exact solution over the element. More...
 
virtual void output_fct (std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
 Output a time-dependent exact solution over the element. More...
 
virtual void output_fct (std::ostream &outfile, const unsigned &n_plot, const double &time, const SolutionFunctorBase &exact_soln) const
 Output a time-dependent exact solution over the element. More...
 
virtual void get_s_plot (const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
 
virtual std::string tecplot_zone_string (const unsigned &nplot) const
 
virtual void write_tecplot_zone_footer (std::ostream &outfile, const unsigned &nplot) const
 
virtual void write_tecplot_zone_footer (FILE *file_pt, const unsigned &nplot) const
 
virtual unsigned nplot_points (const unsigned &nplot) const
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 Calculate the norm of the error and that of the exact solution. More...
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 Calculate the norm of the error and that of the exact solution. More...
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_abs_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error)
 
void integrate_fct (FiniteElement::SteadyExactSolutionFctPt integrand_fct_pt, Vector< double > &integral)
 Integrate Vector-valued function over element. More...
 
void integrate_fct (FiniteElement::UnsteadyExactSolutionFctPt integrand_fct_pt, const double &time, Vector< double > &integral)
 Integrate Vector-valued time-dep function over element. More...
 
virtual void build_face_element (const int &face_index, FaceElement *face_element_pt)
 
virtual unsigned self_test ()
 
virtual unsigned get_bulk_node_number (const int &face_index, const unsigned &i) const
 
virtual int face_outer_unit_normal_sign (const int &face_index) const
 Get the sign of the outer unit normal on the face given by face_index. More...
 
virtual unsigned nnode_on_face () const
 
void face_node_number_error_check (const unsigned &i) const
 Range check for face node numbers. More...
 
virtual CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt (const int &face_index) const
 
virtual BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt (const int &face_index) const
 
- Public Member Functions inherited from oomph::GeneralisedElement
 GeneralisedElement ()
 Constructor: Initialise all pointers and all values to zero. More...
 
virtual ~GeneralisedElement ()
 Virtual destructor to clean up any memory allocated by the object. More...
 
 GeneralisedElement (const GeneralisedElement &)=delete
 Broken copy constructor. More...
 
void operator= (const GeneralisedElement &)=delete
 Broken assignment operator. More...
 
Data *& internal_data_pt (const unsigned &i)
 Return a pointer to i-th internal data object. More...
 
Data *const & internal_data_pt (const unsigned &i) const
 Return a pointer to i-th internal data object (const version) More...
 
Data *& external_data_pt (const unsigned &i)
 Return a pointer to i-th external data object. More...
 
Data *const & external_data_pt (const unsigned &i) const
 Return a pointer to i-th external data object (const version) More...
 
unsigned long eqn_number (const unsigned &ieqn_local) const
 
int local_eqn_number (const unsigned long &ieqn_global) const
 
unsigned add_external_data (Data *const &data_pt, const bool &fd=true)
 
bool external_data_fd (const unsigned &i) const
 
void exclude_external_data_fd (const unsigned &i)
 
void include_external_data_fd (const unsigned &i)
 
void flush_external_data ()
 Flush all external data. More...
 
void flush_external_data (Data *const &data_pt)
 Flush the object addressed by data_pt from the external data array. More...
 
unsigned ninternal_data () const
 Return the number of internal data objects. More...
 
unsigned nexternal_data () const
 Return the number of external data objects. More...
 
unsigned ndof () const
 Return the number of equations/dofs in the element. More...
 
void dof_vector (const unsigned &t, Vector< double > &dof)
 Return the vector of dof values at time level t. More...
 
void dof_pt_vector (Vector< double * > &dof_pt)
 Return the vector of pointers to dof values. More...
 
void set_internal_data_time_stepper (const unsigned &i, TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
void assign_internal_eqn_numbers (unsigned long &global_number, Vector< double * > &Dof_pt)
 
void describe_dofs (std::ostream &out, const std::string &current_string) const
 
void add_internal_value_pt_to_map (std::map< unsigned, double * > &map_of_value_pt)
 
virtual void assign_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void complete_setup_of_dependencies ()
 
virtual void get_residuals (Vector< double > &residuals)
 
virtual void get_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
virtual void get_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void get_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
virtual void get_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void get_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void get_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void get_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void get_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void get_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
virtual void compute_norm (Vector< double > &norm)
 
virtual void compute_norm (double &norm)
 
virtual unsigned ndof_types () const
 
virtual void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- Public Member Functions inherited from oomph::GeomObject
 GeomObject ()
 Default constructor. More...
 
 GeomObject (const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
 
 GeomObject (const GeomObject &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const GeomObject &)=delete
 Broken assignment operator. More...
 
virtual ~GeomObject ()
 (Empty) destructor More...
 
unsigned nlagrangian () const
 Access function to # of Lagrangian coordinates. More...
 
unsigned ndim () const
 Access function to # of Eulerian coordinates. More...
 
void set_nlagrangian_and_ndim (const unsigned &n_lagrangian, const unsigned &n_dim)
 Set # of Lagrangian and Eulerian coordinates. More...
 
TimeStepper *& time_stepper_pt ()
 
TimeSteppertime_stepper_pt () const
 
virtual void position (const double &t, const Vector< double > &zeta, Vector< double > &r) const
 
virtual void dposition (const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
 
virtual void d2position (const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
 
virtual void d2position (const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
 

Public Attributes

void(*&)(const double &time, const Vector< double > &x, Vector< double > &fbase_flow_u_fct_pt ()
 Access function for the base flow solution pointer. More...
 
void(*&)(const double &time, const Vector< double > &x, DenseMatrix< double > &fbase_flow_dudx_fct_pt ()
 

Static Public Attributes

static Vector< doubleGamma
 Vector to decide whether the stress-divergence form is used or not. More...
 
- Static Public Attributes inherited from oomph::FiniteElement
static double Tolerance_for_singular_jacobian = 1.0e-16
 Tolerance below which the jacobian is considered singular. More...
 
static bool Accept_negative_jacobian = false
 
static bool Suppress_output_while_checking_for_inverted_elements
 
- Static Public Attributes inherited from oomph::GeneralisedElement
static bool Suppress_warning_about_repeated_internal_data
 
static bool Suppress_warning_about_repeated_external_data = true
 
static double Default_fd_jacobian_step = 1.0e-8
 

Protected Member Functions

virtual int p_local_eqn (const unsigned &n, const unsigned &i)=0
 
virtual double dshape_and_dtest_eulerian_linearised_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_linearised_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual void pshape_linearised_nst (const Vector< double > &s, Shape &psi) const =0
 Compute the pressure shape functions at local coordinate s. More...
 
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. More...
 
virtual void get_base_flow_u (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
 
virtual void get_base_flow_dudx (const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
 
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)
 
- Protected Member Functions inherited from oomph::FiniteElement
virtual void assemble_local_to_eulerian_jacobian (const DShape &dpsids, DenseMatrix< double > &jacobian) const
 
virtual void assemble_local_to_eulerian_jacobian2 (const DShape &d2psids, DenseMatrix< double > &jacobian2) const
 
virtual void assemble_eulerian_base_vectors (const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
 
template<unsigned DIM>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double invert_jacobian_mapping (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual void dJ_eulerian_dnodal_coordinates (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<unsigned DIM>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
virtual void d_dshape_eulerian_dnodal_coordinates (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<unsigned DIM>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
virtual void transform_derivatives (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
void transform_derivatives_diagonal (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
virtual void transform_second_derivatives (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
virtual void fill_in_jacobian_from_nodal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_nodal_by_fd (DenseMatrix< double > &jacobian)
 
virtual void update_before_nodal_fd ()
 
virtual void reset_after_nodal_fd ()
 
virtual void update_in_nodal_fd (const unsigned &i)
 
virtual void reset_in_nodal_fd (const unsigned &i)
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 Zero-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 One-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 Two-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
- Protected Member Functions inherited from oomph::GeneralisedElement
unsigned add_internal_data (Data *const &data_pt, const bool &fd=true)
 
bool internal_data_fd (const unsigned &i) const
 
void exclude_internal_data_fd (const unsigned &i)
 
void include_internal_data_fd (const unsigned &i)
 
void clear_global_eqn_numbers ()
 
void add_global_eqn_numbers (std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
 
virtual void assign_internal_and_external_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_additional_local_eqn_numbers ()
 
int internal_local_eqn (const unsigned &i, const unsigned &j) const
 
int external_local_eqn (const unsigned &i, const unsigned &j)
 
void fill_in_jacobian_from_internal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_internal_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
virtual void update_before_internal_fd ()
 
virtual void reset_after_internal_fd ()
 
virtual void update_in_internal_fd (const unsigned &i)
 
virtual void reset_in_internal_fd (const unsigned &i)
 
virtual void update_before_external_fd ()
 
virtual void reset_after_external_fd ()
 
virtual void update_in_external_fd (const unsigned &i)
 
virtual void reset_in_external_fd (const unsigned &i)
 
virtual void fill_in_contribution_to_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void fill_in_contribution_to_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void fill_in_contribution_to_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 

Protected Attributes

doubleViscosity_Ratio_pt
 
doubleDensity_Ratio_pt
 
doubleRe_pt
 Pointer to global Reynolds number. More...
 
doubleReSt_pt
 Pointer to global Reynolds number x Strouhal number (=Womersley) More...
 
doubleLambda_pt
 Pointer to eigenvalue. More...
 
doubleOmega_pt
 Pointer to frequency. More...
 
LinearisedNavierStokesEigenfunctionNormalisationElementNormalisation_element_pt
 Pointer to the normalisation element. More...
 
unsigned Data_number_of_eigenvalue
 Index of datum where eigenvalue is stored. More...
 
unsigned Index_of_eigenvalue
 
void(* Base_flow_u_fct_pt )(const double &time, const Vector< double > &x, Vector< double > &result)
 Pointer to base flow solution (velocity components) function. More...
 
void(* Base_flow_dudx_fct_pt )(const double &time, const Vector< double > &x, DenseMatrix< double > &result)
 
bool ALE_is_disabled
 
- Protected Attributes inherited from oomph::FiniteElement
MacroElementMacro_elem_pt
 Pointer to the element's macro element (NULL by default) More...
 
- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 

Static Private Attributes

static int Pressure_not_stored_at_node = -100
 
static double Default_Physical_Constant_Value = 0.0
 
static double Default_Physical_Ratio_Value = 1.0
 Static default value for the physical ratios (all initialised to one) More...
 

Additional Inherited Members

- Public Types inherited from oomph::FiniteElement
typedef void(* SteadyExactSolutionFctPt) (const Vector< double > &, Vector< double > &)
 
typedef void(* UnsteadyExactSolutionFctPt) (const double &, const Vector< double > &, Vector< double > &)
 
- Static Protected Attributes inherited from oomph::FiniteElement
static const unsigned Default_Initial_Nvalue = 0
 Default value for the number of values at a node. More...
 
static const double Node_location_tolerance = 1.0e-14
 
static const unsigned N2deriv [] = {0, 1, 3, 6}
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 

Detailed Description

A class for elements that solve the linearised version of the unsteady Navier–Stokes equations in cylindrical polar coordinates, where we have Fourier-decomposed in the azimuthal direction so that the theta-dependance is replaced by an azimuthal mode number.

Constructor & Destructor Documentation

◆ LinearisedNavierStokesEquations()

oomph::LinearisedNavierStokesEquations::LinearisedNavierStokesEquations ( )
inline

Constructor: NULL the base flow solution and the derivatives of the base flow function

223  {
224  // Set all the physical parameter pointers to the default value of zero
227 
230 
231  // Set to sensible defaults
234 
235  // Set the physical ratios to the default value of one
238 
239  // Null out normalisation
241  }
void(* Base_flow_dudx_fct_pt)(const double &time, const Vector< double > &x, DenseMatrix< double > &result)
Definition: linearised_navier_stokes_elements.h:108
unsigned Data_number_of_eigenvalue
Index of datum where eigenvalue is stored.
Definition: linearised_navier_stokes_elements.h:97
LinearisedNavierStokesEigenfunctionNormalisationElement * Normalisation_element_pt
Pointer to the normalisation element.
Definition: linearised_navier_stokes_elements.h:93
bool ALE_is_disabled
Definition: linearised_navier_stokes_elements.h:115
double * Lambda_pt
Pointer to eigenvalue.
Definition: linearised_navier_stokes_elements.h:86
double * Viscosity_Ratio_pt
Definition: linearised_navier_stokes_elements.h:73
void(* Base_flow_u_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to base flow solution (velocity components) function.
Definition: linearised_navier_stokes_elements.h:102
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
Definition: linearised_navier_stokes_elements.h:83
double * Re_pt
Pointer to global Reynolds number.
Definition: linearised_navier_stokes_elements.h:80
unsigned Index_of_eigenvalue
Definition: linearised_navier_stokes_elements.h:99
double * Density_Ratio_pt
Definition: linearised_navier_stokes_elements.h:77
static double Default_Physical_Constant_Value
Definition: linearised_navier_stokes_elements.h:62
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all initialised to one)
Definition: linearised_navier_stokes_elements.h:65
double * Omega_pt
Pointer to frequency.
Definition: linearised_navier_stokes_elements.h:89

References Data_number_of_eigenvalue, Default_Physical_Constant_Value, Default_Physical_Ratio_Value, Density_Ratio_pt, Index_of_eigenvalue, Lambda_pt, Normalisation_element_pt, Omega_pt, Re_pt, ReSt_pt, and Viscosity_Ratio_pt.

Member Function Documentation

◆ density_ratio()

const double& oomph::LinearisedNavierStokesEquations::density_ratio ( ) const
inline

Density ratio for element: element's density relative to the viscosity used in the definition of the Reynolds number

343  {
344  return *Density_Ratio_pt;
345  }

References Density_Ratio_pt.

Referenced by fill_in_generic_residual_contribution_linearised_nst(), and oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst().

◆ density_ratio_pt()

double*& oomph::LinearisedNavierStokesEquations::density_ratio_pt ( )
inline

Pointer to the density ratio.

349  {
350  return Density_Ratio_pt;
351  }

References Density_Ratio_pt.

Referenced by oomph::RefineableLinearisedNavierStokesEquations::further_build().

◆ disable_ALE()

void oomph::LinearisedNavierStokesEquations::disable_ALE ( )
inlinevirtual

Disable ALE, i.e. assert the mesh is not moving – you do this at your own risk!

Reimplemented from oomph::FiniteElement.

418  {
419  ALE_is_disabled = true;
420  }

References ALE_is_disabled.

◆ dshape_and_dtest_eulerian_at_knot_linearised_nst()

virtual double oomph::LinearisedNavierStokesEquations::dshape_and_dtest_eulerian_at_knot_linearised_nst ( const unsigned ipt,
Shape psi,
DShape dpsidx,
Shape test,
DShape dtestdx 
) const
protectedpure virtual

Compute the shape functions and their derivatives w.r.t. global coordinates at the ipt-th integration point. Return Jacobian of mapping between local and global coordinates.

Implemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

Referenced by fill_in_generic_residual_contribution_linearised_nst(), and oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst().

◆ dshape_and_dtest_eulerian_linearised_nst()

virtual double oomph::LinearisedNavierStokesEquations::dshape_and_dtest_eulerian_linearised_nst ( const Vector< double > &  s,
Shape psi,
DShape dpsidx,
Shape test,
DShape dtestdx 
) const
protectedpure virtual

Compute the shape functions and their derivatives w.r.t. global coordinates at local coordinate s. Return Jacobian of mapping between local and global coordinates.

Implemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

◆ du_dt_linearised_nst()

double oomph::LinearisedNavierStokesEquations::du_dt_linearised_nst ( const unsigned n,
const unsigned i 
) const
inline

Return the i-th component of du/dt at local node n. Uses suitably interpolated value for hanging nodes.

388  {
389  // Get the data's timestepper
390  TimeStepper* time_stepper_pt = this->node_pt(n)->time_stepper_pt();
391 
392  // Initialise dudt
393  double dudt = 0.0;
394 
395  // Loop over the timesteps, if there is a non-steady timestepper
396  if (!time_stepper_pt->is_steady())
397  {
398  // Get the index at which the velocity is stored
399  const unsigned u_nodal_index = u_index_linearised_nst(i);
400 
401  // Determine number of timsteps (past & present)
402  const unsigned n_time = time_stepper_pt->ntstorage();
403 
404  // Add the contributions to the time derivative
405  for (unsigned t = 0; t < n_time; t++)
406  {
407  dudt +=
408  time_stepper_pt->weight(1, t) * nodal_value(t, n, u_nodal_index);
409  }
410  }
411 
412  return dudt;
413  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
virtual unsigned u_index_linearised_nst(const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:380
unsigned ntstorage() const
Definition: timesteppers.h:601
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:594
bool is_steady() const
Definition: timesteppers.h:389
t
Definition: plotPSD.py:36

References i, oomph::TimeStepper::is_steady(), n, oomph::FiniteElement::nodal_value(), oomph::FiniteElement::node_pt(), oomph::TimeStepper::ntstorage(), plotPSD::t, oomph::GeomObject::time_stepper_pt(), oomph::Data::time_stepper_pt(), u_index_linearised_nst(), and oomph::TimeStepper::weight().

◆ eigenvalue_local_eqn()

int oomph::LinearisedNavierStokesEquations::eigenvalue_local_eqn ( const unsigned i)
inlineprotected

◆ enable_ALE()

void oomph::LinearisedNavierStokesEquations::enable_ALE ( )
inlinevirtual

(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.

Reimplemented from oomph::FiniteElement.

427  {
428  ALE_is_disabled = false;
429  }

References ALE_is_disabled.

◆ fill_in_contribution_to_residuals()

void oomph::LinearisedNavierStokesEquations::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inlinevirtual

Compute the element's residual Vector.

Reimplemented from oomph::GeneralisedElement.

492  {
493  // Call the generic residuals function with flag set to 0
494  // and using a dummy matrix argument
496  residuals,
499  0);
500  }
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227
virtual void fill_in_generic_residual_contribution_linearised_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Definition: linearised_navier_stokes_elements.cc:366

References oomph::GeneralisedElement::Dummy_matrix, and fill_in_generic_residual_contribution_linearised_nst().

◆ fill_in_generic_residual_contribution_linearised_nst()

void oomph::LinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix,
unsigned  flag 
)
protectedvirtual

Compute the residuals for the Navier-Stokes equations; flag=1(or 0): do (or don't) compute the Jacobian as well.

Compute the residuals for the linearised axisymmetric Navier–Stokes equations; flag=1(or 0): do (or don't) compute the Jacobian as well.

Reimplemented in oomph::RefineableLinearisedNavierStokesEquations.

371  {
372  // Get the time from the first node in the element
373  const double time = this->node_pt(0)->time_stepper_pt()->time();
374 
375  // Determine number of nodes in the element
376  const unsigned n_node = nnode();
377 
378  // Determine how many pressure values there are associated with
379  // a single pressure component
380  const unsigned n_pres = npres_linearised_nst();
381 
382  const unsigned n_veloc = 4 * DIM;
383 
384  // Get the nodal indices at which the velocity is stored
385  unsigned u_nodal_index[n_veloc];
386  for (unsigned i = 0; i < n_veloc; ++i)
387  {
388  u_nodal_index[i] = u_index_linearised_nst(i);
389  }
390 
391  // Set up memory for the fluid shape and test functions
392  Shape psif(n_node), testf(n_node);
393  DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
394 
395  // Set up memory for the pressure shape and test functions
396  Shape psip(n_pres), testp(n_pres);
397 
398  // Determine number of integration points
399  const unsigned n_intpt = integral_pt()->nweight();
400 
401  // Set up memory for the vector to hold local coordinates (two dimensions)
402  Vector<double> s(DIM);
403 
404  // Get physical variables from the element
405  // (Reynolds number must be multiplied by the density ratio)
406  const double scaled_re = re() * density_ratio();
407  const double scaled_re_st = re_st() * density_ratio();
408  const double visc_ratio = viscosity_ratio();
409 
410  const double eval_real = lambda();
411  const double eval_imag = omega();
412 
413  const std::complex<double> eigenvalue(eval_real, eval_imag);
414 
415  // Integers used to store the local equation and unknown numbers
416  int local_eqn = 0;
417 
418  // Loop over the integration points
419  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
420  {
421  // Assign values of the local coordinates s
422  for (unsigned i = 0; i < DIM; i++)
423  {
424  s[i] = integral_pt()->knot(ipt, i);
425  }
426 
427  // Get the integral weight
428  const double w = integral_pt()->weight(ipt);
429 
430  // Calculate the fluid shape and test functions, and their derivatives
431  // w.r.t. the global coordinates
433  ipt, psif, dpsifdx, testf, dtestfdx);
434 
435  // Calculate the pressure shape and test functions
436  pshape_linearised_nst(s, psip, testp);
437 
438  // Premultiply the weights and the Jacobian of the mapping between
439  // local and global coordinates
440  const double W = w * J;
441 
442  // Allocate storage for the position and the derivative of the
443  // mesh positions w.r.t. time
444  Vector<double> interpolated_x(DIM, 0.0);
445  // Vector<double> mesh_velocity(2,0.0);
446 
447  // Allocate storage for the velocity components (six of these)
448  // and their derivatives w.r.t. time
449  Vector<std::complex<double>> interpolated_u(DIM);
450  // Vector<double> dudt(6,0.0);
451  // Allocate storage for the eigen function normalisation
452  Vector<std::complex<double>> interpolated_u_normalisation(DIM);
453  for (unsigned i = 0; i < DIM; ++i)
454  {
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);
459  }
460 
461  // Allocate storage for the pressure components (two of these
462  std::complex<double> interpolated_p(0.0, 0.0);
463  std::complex<double> interpolated_p_normalisation(0.0, 0.0);
464 
465  // Allocate storage for the derivatives of the velocity components
466  // w.r.t. global coordinates (r and z)
467  Vector<Vector<std::complex<double>>> interpolated_dudx(DIM);
468  for (unsigned i = 0; i < DIM; ++i)
469  {
470  interpolated_dudx[i].resize(DIM);
471  for (unsigned j = 0; j < DIM; ++j)
472  {
473  interpolated_dudx[i][j].real(0.0);
474  interpolated_dudx[i][j].imag(0.0);
475  }
476  }
477 
478  // Calculate pressure at the integration point
479  // -------------------------------------------
480 
481  // Loop over pressure degrees of freedom (associated with a single
482  // pressure component) in the element
483  for (unsigned l = 0; l < n_pres; l++)
484  {
485  // Cache the shape function
486  const double psip_ = psip(l);
487 
488  // Get the complex nodal pressure values
489  const std::complex<double> p_value(this->p_linearised_nst(l, 0),
490  this->p_linearised_nst(l, 1));
491 
492  // Add contribution
493  interpolated_p += p_value * psip_;
494 
495  // Repeat for normalisation
496  const std::complex<double> p_norm_value(this->p_linearised_nst(l, 2),
497  this->p_linearised_nst(l, 3));
498  interpolated_p_normalisation += p_norm_value * psip_;
499  }
500  // End of loop over the pressure degrees of freedom in the element
501 
502  // Calculate velocities and their derivatives at the integration point
503  // -------------------------------------------------------------------
504 
505  // Loop over the element's nodes
506  for (unsigned l = 0; l < n_node; l++)
507  {
508  // Cache the shape function
509  const double psif_ = psif(l);
510 
511  // Loop over the DIM coordinate directions
512  for (unsigned i = 0; i < DIM; i++)
513  {
514  interpolated_x[i] += this->raw_nodal_position(l, i) * psif_;
515  }
516 
517  // Loop over the DIM complex velocity components
518  for (unsigned i = 0; i < DIM; i++)
519  {
520  // Get the value
521  const std::complex<double> u_value(
522  this->raw_nodal_value(l, u_nodal_index[2 * i + 0]),
523  this->raw_nodal_value(l, u_nodal_index[2 * i + 1]));
524 
525  // Add contribution
526  interpolated_u[i] += u_value * psif_;
527 
528  // Add contribution to dudt
529  // dudt[i] += du_dt_linearised_nst(l,i)*psif_;
530 
531  // Loop over two coordinate directions (for derivatives)
532  for (unsigned j = 0; j < DIM; j++)
533  {
534  interpolated_dudx[i][j] += u_value * dpsifdx(l, j);
535  }
536 
537  // Interpolate the normalisation function
538  const std::complex<double> normalisation_value(
539  this->raw_nodal_value(l, u_nodal_index[2 * (DIM + i)]),
540  this->raw_nodal_value(l, u_nodal_index[2 * (DIM + i) + 1]));
541  interpolated_u_normalisation[i] += normalisation_value * psif_;
542  }
543  } // End of loop over the element's nodes
544 
545  // Get the mesh velocity if ALE is enabled
546  /*if(!ALE_is_disabled)
547  {
548  // Loop over the element's nodes
549  for(unsigned l=0;l<n_node;l++)
550  {
551  // Loop over the two coordinate directions
552  for(unsigned i=0;i<2;i++)
553  {
554  mesh_velocity[i] += this->raw_dnodal_position_dt(l,i)*psif(l);
555  }
556  }
557  }*/
558 
559  // Get velocities and their derivatives from base flow problem
560  // -----------------------------------------------------------
561 
562  // Allocate storage for the velocity components of the base state
563  // solution (initialise to zero)
564  Vector<double> base_flow_u(DIM, 0.0);
565 
566  // Get the user-defined base state solution velocity components
567  get_base_flow_u(time, ipt, interpolated_x, base_flow_u);
568 
569  // Allocate storage for the derivatives of the base state solution's
570  // velocity components w.r.t. global coordinate (r and z)
571  // N.B. the derivatives of the base flow components w.r.t. the
572  // azimuthal coordinate direction (theta) are always zero since the
573  // base flow is axisymmetric
574  DenseMatrix<double> base_flow_dudx(DIM, DIM, 0.0);
575 
576  // Get the derivatives of the user-defined base state solution
577  // velocity components w.r.t. global coordinates
578  get_base_flow_dudx(time, ipt, interpolated_x, base_flow_dudx);
579 
580 
581  // MOMENTUM EQUATIONS
582  //------------------
583 
584  // Loop over the test functions
585  for (unsigned l = 0; l < n_node; l++)
586  {
587  // Loop over the velocity components
588  for (unsigned i = 0; i < DIM; i++)
589  {
590  // Assemble the residuals
591  // Time dependent term
592  std::complex<double> residual_contribution =
593  -scaled_re_st * eigenvalue * interpolated_u[i] * testf[l] * W;
594  // Pressure term
595  residual_contribution += interpolated_p * dtestfdx(l, i) * W;
596  // Viscous terms
597  for (unsigned k = 0; k < DIM; ++k)
598  {
599  residual_contribution -=
600  visc_ratio *
601  (interpolated_dudx[i][k] + Gamma[i] * interpolated_dudx[k][i]) *
602  dtestfdx(l, k) * W;
603  }
604 
605  // Advective terms
606  for (unsigned k = 0; k < DIM; ++k)
607  {
608  residual_contribution -=
609  scaled_re *
610  (base_flow_u[k] * interpolated_dudx[i][k] +
611  interpolated_u[k] * base_flow_dudx(i, k)) *
612  testf[l] * W;
613  }
614 
615  // Now separate real and imaginary parts
616 
617  /*IF it's not a boundary condition*/
618  // Here assume that we're only going to pin entire complex
619  // number or not
620  local_eqn = nodal_local_eqn(l, u_nodal_index[2 * i]);
621  if (local_eqn >= 0)
622  {
623  residuals[local_eqn] += residual_contribution.real();
624  }
625 
626  local_eqn = nodal_local_eqn(l, u_nodal_index[2 * i + 1]);
627  if (local_eqn >= 0)
628  {
629  residuals[local_eqn] += residual_contribution.imag();
630  }
631 
632 
633  // CALCULATE THE JACOBIAN
634  /*if(flag)
635  {
636  //Loop over the velocity shape functions again
637  for(unsigned l2=0;l2<n_node;l2++)
638  {
639  //Loop over the velocity components again
640  for(unsigned i2=0;i2<DIM;i2++)
641  {
642  //If at a non-zero degree of freedom add in the entry
643  local_unknown = nodal_local_eqn(l2,u_nodal_index[i2]);
644  if(local_unknown >= 0)
645  {
646  //Add contribution to Elemental Matrix
647  jacobian(local_eqn,local_unknown)
648  -= visc_ratio*Gamma[i]*dpsifdx(l2,i)*dtestfdx(l,i2)*W;
649 
650  //Extra component if i2 = i
651  if(i2 == i)
652  {
653  //Loop over velocity components
654  for(unsigned k=0;k<DIM;k++)
655  {
656  jacobian(local_eqn,local_unknown)
657  -= visc_ratio*dpsifdx(l2,k)*dtestfdx(l,k)*W;
658  }
659  }
660 
661  //Now add in the inertial terms
662  jacobian(local_eqn,local_unknown)
663  -= scaled_re*psif[l2]*interpolated_dudx(i,i2)*testf[l]*W;
664 
665  //Extra component if i2=i
666  if(i2 == i)
667  {
668  //Add the mass matrix term (only diagonal entries)
669  //Note that this is positive because the mass matrix
670  //is taken to the other side of the equation when
671  //formulating the generalised eigenproblem.
672  if(flag==2)
673  {
674  mass_matrix(local_eqn,local_unknown) +=
675  scaled_re_st*psif[l2]*testf[l]*W;
676  }
677 
678  //du/dt term
679  jacobian(local_eqn,local_unknown)
680  -= scaled_re_st*
681  node_pt(l2)->time_stepper_pt()->weight(1,0)*
682  psif[l2]*testf[l]*W;
683 
684  //Loop over the velocity components
685  for(unsigned k=0;k<DIM;k++)
686  {
687  double tmp=scaled_re*interpolated_u[k];
688  if (!ALE_is_disabled) tmp-=scaled_re_st*mesh_velocity[k];
689  jacobian(local_eqn,local_unknown) -=
690  tmp*dpsifdx(l2,k)*testf[l]*W;
691  }
692  }
693 
694  }
695  }
696  }
697 
698  //Now loop over pressure shape functions
699  //This is the contribution from pressure gradient
700  for(unsigned l2=0;l2<n_pres;l2++)
701  {
702  //If we are at a non-zero degree of freedom in the entry
703  local_unknown = p_local_eqn(l2);
704  if(local_unknown >= 0)
705  {
706  jacobian(local_eqn,local_unknown)
707  += psip[l2]*dtestfdx(l,i)*W;
708  }
709  }
710  } //End of Jacobian calculation
711 
712  }*/ //End of if not boundary condition statement
713 
714  } // End of loop over dimension
715  } // End of loop over shape functions
716 
717 
718  // CONTINUITY EQUATION
719  //-------------------
720 
721  // Loop over the shape functions
722  for (unsigned l = 0; l < n_pres; l++)
723  {
724  // Assemble the residuals
725  std::complex<double> residual_contribution = interpolated_dudx[0][0];
726  for (unsigned k = 1; k < DIM; ++k)
727  {
728  residual_contribution += interpolated_dudx[k][k];
729  }
730 
731  local_eqn = p_local_eqn(l, 0);
732  // If not a boundary conditions
733  if (local_eqn >= 0)
734  {
735  residuals[local_eqn] += residual_contribution.real() * testp[l] * W;
736  }
737 
738  local_eqn = p_local_eqn(l, 1);
739  // If not a boundary conditions
740  if (local_eqn >= 0)
741  {
742  residuals[local_eqn] += residual_contribution.imag() * testp[l] * W;
743  }
744 
745  } // End of loop over l
746 
747  // Normalisation condition
748  std::complex<double> residual_contribution =
749  interpolated_p_normalisation * interpolated_p;
750  for (unsigned k = 0; k < DIM; ++k)
751  {
752  residual_contribution +=
753  interpolated_u_normalisation[k] * interpolated_u[k];
754  }
755 
756  local_eqn = this->eigenvalue_local_eqn(0);
757  if (local_eqn >= 0)
758  {
759  residuals[local_eqn] += residual_contribution.real() * W;
760  }
761 
762  local_eqn = this->eigenvalue_local_eqn(1);
763  if (local_eqn >= 0)
764  {
765  residuals[local_eqn] += residual_contribution.imag() * W;
766  }
767 
768  } // End of loop over the integration points
769 
770  } // End of fill_in_generic_residual_contribution_linearised_nst
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2576
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.cc:1686
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.
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
Definition: linearised_navier_stokes_elements.h:247
virtual unsigned npres_linearised_nst() const =0
const double & re() const
Reynolds number.
Definition: linearised_navier_stokes_elements.h:253
virtual int p_local_eqn(const unsigned &n, const unsigned &i)=0
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
Definition: linearised_navier_stokes_elements.h:259
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
Definition: linearised_navier_stokes_elements.h:153
virtual double p_linearised_nst(const unsigned &n_p, const unsigned &i) const =0
virtual double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
int eigenvalue_local_eqn(const unsigned &i)
Definition: linearised_navier_stokes_elements.h:203
const double & lambda() const
Definition: linearised_navier_stokes_elements.h:264
virtual void get_base_flow_dudx(const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
Definition: linearised_navier_stokes_elements.h:177
const double & viscosity_ratio() const
Definition: linearised_navier_stokes_elements.h:329
const double & omega() const
Definition: linearised_navier_stokes_elements.h:269
const double & density_ratio() const
Definition: linearised_navier_stokes_elements.h:342
double & time()
Return current value of continous time.
Definition: timesteppers.h:332
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
#define DIM
Definition: linearised_navier_stokes_elements.h:44
@ W
Definition: quadtree.h:63
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References density_ratio(), DIM, dshape_and_dtest_eulerian_at_knot_linearised_nst(), eigenvalue_local_eqn(), Gamma, get_base_flow_dudx(), get_base_flow_u(), i, oomph::FiniteElement::integral_pt(), oomph::FiniteElement::interpolated_x(), J, j, k, oomph::Integral::knot(), lambda(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_local_eqn(), oomph::FiniteElement::node_pt(), npres_linearised_nst(), oomph::Integral::nweight(), omega(), p_linearised_nst(), p_local_eqn(), pshape_linearised_nst(), oomph::FiniteElement::raw_nodal_position(), oomph::FiniteElement::raw_nodal_value(), re(), re_st(), s, oomph::TimeStepper::time(), oomph::Data::time_stepper_pt(), u_index_linearised_nst(), viscosity_ratio(), w, oomph::QuadTreeNames::W, and oomph::Integral::weight().

Referenced by fill_in_contribution_to_residuals().

◆ get_base_flow_dudx()

virtual void oomph::LinearisedNavierStokesEquations::get_base_flow_dudx ( const double time,
const unsigned ipt,
const Vector< double > &  x,
DenseMatrix< double > &  result 
) const
inlineprotectedvirtual

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

Reimplemented in RefineableLinearisedQCrouzeixRaviartMultiDomainElement, RefineableLinearisedQTaylorHoodMultiDomainElement, LinearisedQCrouzeixRaviartMultiDomainElement, and LinearisedQTaylorHoodMultiDomainElement.

181  {
182  // If the function pointer is zero return zero
183  if (Base_flow_dudx_fct_pt == 0)
184  {
185  // Loop over velocity components
186  for (unsigned i = 0; i < DIM; i++)
187  {
188  // Loop over coordinate directions and set to zero
189  for (unsigned j = 0; j < DIM; j++)
190  {
191  result(i, j) = 0.0;
192  }
193  }
194  }
195  // Otherwise call the function
196  else
197  {
198  (*Base_flow_dudx_fct_pt)(time, x, result);
199  }
200  }
list x
Definition: plotDoE.py:28

References Base_flow_dudx_fct_pt, DIM, i, j, and plotDoE::x.

Referenced by fill_in_generic_residual_contribution_linearised_nst(), and oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst().

◆ get_base_flow_u()

virtual void oomph::LinearisedNavierStokesEquations::get_base_flow_u ( const double time,
const unsigned ipt,
const Vector< double > &  x,
Vector< double > &  result 
) const
inlineprotectedvirtual

Calculate the velocity components of the base flow solution at a given time and Eulerian position

Reimplemented in RefineableLinearisedQCrouzeixRaviartMultiDomainElement, RefineableLinearisedQTaylorHoodMultiDomainElement, LinearisedQCrouzeixRaviartMultiDomainElement, and LinearisedQTaylorHoodMultiDomainElement.

157  {
158  // If the function pointer is zero return zero
159  if (Base_flow_u_fct_pt == 0)
160  {
161  // Loop over velocity components and set base flow solution to zero
162  for (unsigned i = 0; i < DIM; i++)
163  {
164  result[i] = 0.0;
165  }
166  }
167  // Otherwise call the function
168  else
169  {
170  (*Base_flow_u_fct_pt)(time, x, result);
171  }
172  }

References Base_flow_u_fct_pt, DIM, i, and plotDoE::x.

Referenced by fill_in_generic_residual_contribution_linearised_nst(), and oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst().

◆ interpolated_p_linearised_nst()

double oomph::LinearisedNavierStokesEquations::interpolated_p_linearised_nst ( const Vector< double > &  s,
const unsigned i 
) const
inline

Return the i-th component of the FE interpolated pressure p[i] at local coordinate s

556  {
557  // Determine number of pressure nodes in the element
558  const unsigned n_pressure_nodes = npres_linearised_nst();
559 
560  // Provide storage for local shape functions
561  Shape psi(n_pressure_nodes);
562 
563  // Find values of shape functions
564  pshape_linearised_nst(s, psi);
565 
566  // Initialise value of p
567  double interpolated_p = 0.0;
568 
569  // Loop over the local nodes and sum
570  for (unsigned l = 0; l < n_pressure_nodes; l++)
571  {
572  // N.B. The pure virtual function p_linearised_nst(...)
573  // automatically calculates the index at which the pressure value
574  // is stored, so we don't need to worry about this here
575  interpolated_p += p_linearised_nst(l, i) * psi[l];
576  }
577 
578  return (interpolated_p);
579  }

References i, npres_linearised_nst(), p_linearised_nst(), pshape_linearised_nst(), and s.

Referenced by oomph::RefineableLinearisedQCrouzeixRaviartElement::further_build(), oomph::RefineableLinearisedQTaylorHoodElement::get_interpolated_values(), and output().

◆ interpolated_u_linearised_nst()

double oomph::LinearisedNavierStokesEquations::interpolated_u_linearised_nst ( const Vector< double > &  s,
const unsigned i 
) const
inline

Compute the element's residual Vector and the jacobian matrix. Virtual function can be overloaded by hanging-node version. Add the element's contribution to its residuals vector, jacobian matrix and mass matrix Return the i-th component of the FE interpolated velocity u[i] at local coordinate s

527  {
528  // Determine number of nodes in the element
529  const unsigned n_node = nnode();
530 
531  // Provide storage for local shape functions
532  Shape psi(n_node);
533 
534  // Find values of shape functions
535  shape(s, psi);
536 
537  // Get the index at which the velocity is stored
538  const unsigned u_nodal_index = u_index_linearised_nst(i);
539 
540  // Initialise value of u
541  double interpolated_u = 0.0;
542 
543  // Loop over the local nodes and sum
544  for (unsigned l = 0; l < n_node; l++)
545  {
546  interpolated_u += nodal_value(l, u_nodal_index) * psi[l];
547  }
548 
549  return (interpolated_u);
550  }
virtual void shape(const Vector< double > &s, Shape &psi) const =0

References i, oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_value(), s, oomph::FiniteElement::shape(), and u_index_linearised_nst().

Referenced by oomph::RefineableLinearisedQCrouzeixRaviartElement::get_interpolated_values(), oomph::RefineableLinearisedQTaylorHoodElement::get_interpolated_values(), and output().

◆ lambda()

const double& oomph::LinearisedNavierStokesEquations::lambda ( ) const
inline

◆ lambda_pt()

double*& oomph::LinearisedNavierStokesEquations::lambda_pt ( )
inline

Pointer to lambda.

288  {
289  return Lambda_pt;
290  }

References Lambda_pt.

◆ normalisation_element_pt()

LinearisedNavierStokesEigenfunctionNormalisationElement* oomph::LinearisedNavierStokesEquations::normalisation_element_pt ( )
inline

Pointer to normalisation element.

300  {
302  }

References Normalisation_element_pt.

Referenced by oomph::RefineableLinearisedNavierStokesEquations::further_build().

◆ npres_linearised_nst()

virtual unsigned oomph::LinearisedNavierStokesEquations::npres_linearised_nst ( ) const
pure virtual

◆ omega()

const double& oomph::LinearisedNavierStokesEquations::omega ( ) const
inline

◆ omega_pt()

double*& oomph::LinearisedNavierStokesEquations::omega_pt ( )
inline

Pointer to frequency.

294  {
295  return Omega_pt;
296  }

References Omega_pt.

◆ output() [1/4]

void oomph::LinearisedNavierStokesEquations::output ( FILE *  file_pt)
inlinevirtual

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 plot points

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

474  {
475  const unsigned nplot = 5;
476  output(file_pt, nplot);
477  }
void output(std::ostream &outfile)
Definition: linearised_navier_stokes_elements.h:461

References output().

◆ output() [2/4]

void oomph::LinearisedNavierStokesEquations::output ( FILE *  file_pt,
const unsigned nplot 
)
virtual

Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S in tecplot format. nplot points in each coordinate direction

Output function in tecplot format: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S Specified number of plot points in each coordinate direction.

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

196  {
197  // Provide storage for vector of local coordinates
198  Vector<double> s(2);
199 
200  // Tecplot header info
201  fprintf(file_pt, "%s ", tecplot_zone_string(nplot).c_str());
202 
203  // Determine number of plot points
204  const unsigned n_plot_points = nplot_points(nplot);
205 
206  // Loop over plot points
207  for (unsigned iplot = 0; iplot < n_plot_points; iplot++)
208  {
209  // Get local coordinates of plot point
210  get_s_plot(iplot, nplot, s);
211 
212  // Output global coordinates to file
213  for (unsigned i = 0; i < 2; i++)
214  {
215  fprintf(file_pt, "%g ", interpolated_x(s, i));
216  }
217 
218  // Output velocities to file
219  for (unsigned i = 0; i < (2 * DIM); i++)
220  {
221  fprintf(file_pt, "%g ", interpolated_u_linearised_nst(s, i));
222  }
223 
224  // Output pressure to file
225  for (unsigned i = 0; i < 2; i++)
226  {
227  fprintf(file_pt, "%g ", interpolated_p_linearised_nst(s, i));
228  }
229 
230  fprintf(file_pt, "\n");
231  }
232 
233  fprintf(file_pt, "\n");
234 
235  // Write tecplot footer (e.g. FE connectivity lists)
236  write_tecplot_zone_footer(file_pt, nplot);
237 
238  } // End of output
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Definition: elements.h:3161
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Definition: elements.h:3148
virtual unsigned nplot_points(const unsigned &nplot) const
Definition: elements.h:3186
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Definition: elements.h:3174
double interpolated_p_linearised_nst(const Vector< double > &s, const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:554
double interpolated_u_linearised_nst(const Vector< double > &s, const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:525

References DIM, oomph::FiniteElement::get_s_plot(), i, interpolated_p_linearised_nst(), interpolated_u_linearised_nst(), oomph::FiniteElement::interpolated_x(), oomph::FiniteElement::nplot_points(), s, oomph::FiniteElement::tecplot_zone_string(), and oomph::FiniteElement::write_tecplot_zone_footer().

◆ output() [3/4]

void oomph::LinearisedNavierStokesEquations::output ( std::ostream &  outfile)
inlinevirtual

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 plot points

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

462  {
463  const unsigned nplot = 5;
464  output(outfile, nplot);
465  }

Referenced by output(), oomph::LinearisedQCrouzeixRaviartElement::output(), and oomph::LinearisedQTaylorHoodElement::output().

◆ output() [4/4]

void oomph::LinearisedNavierStokesEquations::output ( std::ostream &  outfile,
const unsigned nplot 
)
virtual

Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S in tecplot format. nplot points in each coordinate direction

Output function in tecplot format: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S in tecplot format. Specified number of plot points in each coordinate direction.

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

145  {
146  // Provide storage for vector of local coordinates
147  Vector<double> s(DIM);
148 
149  // Tecplot header info
150  outfile << tecplot_zone_string(nplot);
151 
152  // Determine number of plot points
153  const unsigned n_plot_points = nplot_points(nplot);
154 
155  // Loop over plot points
156  for (unsigned iplot = 0; iplot < n_plot_points; iplot++)
157  {
158  // Get local coordinates of plot point
159  get_s_plot(iplot, nplot, s);
160 
161  // Output global coordinates to file
162  for (unsigned i = 0; i < DIM; i++)
163  {
164  outfile << interpolated_x(s, i) << " ";
165  }
166 
167  // Output velocities (and normalisation) to file
168  for (unsigned i = 0; i < (4 * DIM); i++)
169  {
170  outfile << interpolated_u_linearised_nst(s, i) << " ";
171  }
172 
173  // Output pressure to file
174  for (unsigned i = 0; i < 2; i++)
175  {
176  outfile << interpolated_p_linearised_nst(s, i) << " ";
177  }
178 
179  outfile << std::endl;
180  }
181  outfile << std::endl;
182 
183  // Write tecplot footer (e.g. FE connectivity lists)
184  write_tecplot_zone_footer(outfile, nplot);
185 
186  } // End of output

References DIM, oomph::FiniteElement::get_s_plot(), i, interpolated_p_linearised_nst(), interpolated_u_linearised_nst(), oomph::FiniteElement::interpolated_x(), oomph::FiniteElement::nplot_points(), s, oomph::FiniteElement::tecplot_zone_string(), and oomph::FiniteElement::write_tecplot_zone_footer().

◆ output_veloc()

void oomph::LinearisedNavierStokesEquations::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 coordinate direction at timestep t (t=0: present; t>0: previous timestep)

Output function in tecplot format: Velocities only r, z, U^C, U^S, V^C, V^S, W^C, W^S at specified previous timestep (t=0 present; t>0 previous timestep). Specified number of plot points in each coordinate direction.

59  {
60  // Determine number of nodes in element
61  const unsigned n_node = nnode();
62 
63  // Provide storage for local shape functions
64  Shape psi(n_node);
65 
66  // Provide storage for vectors of local coordinates and
67  // global coordinates and velocities
68  Vector<double> s(DIM);
69  Vector<double> interpolated_x(DIM);
70  Vector<double> interpolated_u(2 * DIM);
71 
72  // Tecplot header info
73  outfile << tecplot_zone_string(nplot);
74 
75  // Determine number of plot points
76  const unsigned n_plot_points = nplot_points(nplot);
77 
78  // Loop over plot points
79  for (unsigned iplot = 0; iplot < n_plot_points; iplot++)
80  {
81  // Get local coordinates of plot point
82  get_s_plot(iplot, nplot, s);
83 
84  // Get shape functions
85  shape(s, psi);
86 
87  // Loop over coordinate directions
88  for (unsigned i = 0; i < DIM; i++)
89  {
90  // Initialise global coordinate
91  interpolated_x[i] = 0.0;
92 
93  // Loop over the local nodes and sum
94  for (unsigned l = 0; l < n_node; l++)
95  {
96  interpolated_x[i] += nodal_position(t, l, i) * psi[l];
97  }
98  }
99 
100  // Loop over the velocity components
101  for (unsigned i = 0; i < (2 * DIM); i++)
102  {
103  // Get the index at which the velocity is stored
104  const unsigned u_nodal_index = u_index_linearised_nst(i);
105 
106  // Initialise velocity
107  interpolated_u[i] = 0.0;
108 
109  // Loop over the local nodes and sum
110  for (unsigned l = 0; l < n_node; l++)
111  {
112  interpolated_u[i] += nodal_value(t, l, u_nodal_index) * psi[l];
113  }
114  }
115 
116  // Output global coordinates to file
117  for (unsigned i = 0; i < DIM; i++)
118  {
119  outfile << interpolated_x[i] << " ";
120  }
121 
122  // Output velocities to file
123  for (unsigned i = 0; i < (2 * DIM); i++)
124  {
125  outfile << interpolated_u[i] << " ";
126  }
127 
128  outfile << std::endl;
129  }
130 
131  // Write tecplot footer (e.g. FE connectivity lists)
132  write_tecplot_zone_footer(outfile, nplot);
133 
134  } // End of output_veloc
double nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:2317

References DIM, oomph::FiniteElement::get_s_plot(), i, oomph::FiniteElement::interpolated_x(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_position(), oomph::FiniteElement::nodal_value(), oomph::FiniteElement::nplot_points(), s, oomph::FiniteElement::shape(), plotPSD::t, oomph::FiniteElement::tecplot_zone_string(), u_index_linearised_nst(), and oomph::FiniteElement::write_tecplot_zone_footer().

◆ p_index_linearised_nst()

virtual int oomph::LinearisedNavierStokesEquations::p_index_linearised_nst ( const unsigned i) const
inlinevirtual

◆ p_linearised_nst()

virtual double oomph::LinearisedNavierStokesEquations::p_linearised_nst ( const unsigned n_p,
const unsigned i 
) const
pure virtual

◆ p_local_eqn()

virtual int oomph::LinearisedNavierStokesEquations::p_local_eqn ( const unsigned n,
const unsigned i 
)
protectedpure virtual

Access function for the local equation number information for the i-th component of the pressure. p_local_eqn[n,i] = local equation number or < 0 if pinned.

Implemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

Referenced by fill_in_generic_residual_contribution_linearised_nst(), and oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst().

◆ pin_pressure_normalisation_dofs()

virtual void oomph::LinearisedNavierStokesEquations::pin_pressure_normalisation_dofs ( )
pure virtual

Pin the normalisation dofs.

Implemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

◆ pin_real_or_imag()

virtual void oomph::LinearisedNavierStokesEquations::pin_real_or_imag ( const unsigned real)
pure virtual

Pin the real or imaginary part of the problem Input integer 0 for real 1 for imaginary

Implemented in oomph::LinearisedQCrouzeixRaviartElement, and oomph::LinearisedQTaylorHoodElement.

◆ pshape_linearised_nst() [1/2]

virtual void oomph::LinearisedNavierStokesEquations::pshape_linearised_nst ( const Vector< double > &  s,
Shape psi 
) const
protectedpure virtual

◆ pshape_linearised_nst() [2/2]

virtual void oomph::LinearisedNavierStokesEquations::pshape_linearised_nst ( const Vector< double > &  s,
Shape psi,
Shape test 
) const
protectedpure virtual

Compute the pressure shape and test functions at local coordinate s.

Implemented in oomph::LinearisedQTaylorHoodElement, and oomph::LinearisedQCrouzeixRaviartElement.

◆ re()

const double& oomph::LinearisedNavierStokesEquations::re ( ) const
inline

◆ re_pt()

double*& oomph::LinearisedNavierStokesEquations::re_pt ( )
inline

Pointer to Reynolds number.

276  {
277  return Re_pt;
278  }

References Re_pt.

Referenced by oomph::RefineableLinearisedNavierStokesEquations::further_build().

◆ re_st()

const double& oomph::LinearisedNavierStokesEquations::re_st ( ) const
inline

Product of Reynolds and Strouhal number (=Womersley number)

260  {
261  return *ReSt_pt;
262  }

References ReSt_pt.

Referenced by fill_in_generic_residual_contribution_linearised_nst(), and oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst().

◆ re_st_pt()

double*& oomph::LinearisedNavierStokesEquations::re_st_pt ( )
inline

Pointer to product of Reynolds and Strouhal number (=Womersley number)

282  {
283  return ReSt_pt;
284  }

References ReSt_pt.

Referenced by oomph::RefineableLinearisedNavierStokesEquations::further_build().

◆ set_eigenfunction_normalisation_element()

void oomph::LinearisedNavierStokesEquations::set_eigenfunction_normalisation_element ( LinearisedNavierStokesEigenfunctionNormalisationElement *const &  normalisation_el_pt)
inline

the boolean flag check_nodal_data is set to false.

308  {
309  // Set the normalisation element
310  Normalisation_element_pt = normalisation_el_pt;
311 
312  // Add eigenvalue unknown as external data to this element
314  this->add_external_data(normalisation_el_pt->eigenvalue_data_pt());
315 
316  // Which value corresponds to the eigenvalue
317  Index_of_eigenvalue = normalisation_el_pt->index_of_eigenvalue();
318 
319  // Now set the pointers to the eigenvalues
320  Lambda_pt = normalisation_el_pt->eigenvalue_data_pt()->value_pt(
322  Omega_pt = normalisation_el_pt->eigenvalue_data_pt()->value_pt(
323  Index_of_eigenvalue + 1);
324  }
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:307

References oomph::GeneralisedElement::add_external_data(), Data_number_of_eigenvalue, oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::eigenvalue_data_pt(), oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::index_of_eigenvalue(), Index_of_eigenvalue, Lambda_pt, Normalisation_element_pt, Omega_pt, and oomph::Data::value_pt().

Referenced by oomph::RefineableLinearisedNavierStokesEquations::further_build().

◆ strain_rate()

void oomph::LinearisedNavierStokesEquations::strain_rate ( const Vector< double > &  s,
DenseMatrix< double > &  strainrate,
const unsigned real 
) const

Strain-rate tensor: \( e_{ij} \) where \( i,j = r,z,\theta \) (in that order)

Get strain-rate tensor: \( e_{ij} \) where \( i,j = r,z,\theta \) (in that order). We evaluate this tensor at a value of theta such that the product of theta and the azimuthal mode number (k) gives \( \pi/4 \). Therefore \( \cos(k \theta) = \sin(k \theta) = 1/\sqrt{2} \).

252  {
253 #ifdef PARANOID
254  if ((strainrate.ncol() != DIM) || (strainrate.nrow() != DIM))
255  {
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;
260 
261  throw OomphLibError(
262  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
263  }
264 #endif
265 
266  // The question is what to do about the real and imaginary parts
267  // The answer is that we know that the "real" velocity is
268  // U_r cos(omega t) - U_i sin(omega t) and we can choose omega t
269  // to be 7pi/4 so that cos = 1/sqrt(2) and sin = -1/sqrt(2)
270  // to get equal contributions
271  double cosomegat = 1.0 / sqrt(2.0);
272  double sinomegat = cosomegat;
273 
274  // Find out how many nodes there are in the element
275  unsigned n_node = nnode();
276 
277  // Set up memory for the shape and test functions
278  Shape psif(n_node);
279  DShape dpsifdx(n_node, DIM);
280 
281  // Call the derivatives of the shape functions
282  dshape_eulerian(s, psif, dpsifdx);
283 
284  // Velocity gradient matrix
285  Vector<Vector<std::complex<double>>> dudx(DIM);
286  // Initialise to zero
287  for (unsigned i = 0; i < DIM; ++i)
288  {
289  dudx[i].resize(DIM);
290  for (unsigned j = 0; j < DIM; ++j)
291  {
292  dudx[i][j].real(0.0);
293  dudx[i][j].imag(0.0);
294  }
295  }
296 
297  // Get the nodal indices at which the velocity is stored
298  unsigned n_veloc = 2 * DIM;
299  unsigned u_nodal_index[n_veloc];
300  for (unsigned i = 0; i < n_veloc; ++i)
301  {
302  u_nodal_index[i] = u_index_linearised_nst(i);
303  }
304 
305  // Loop over the element's nodes
306  for (unsigned l = 0; l < n_node; l++)
307  {
308  // Loop over the DIM complex velocity components
309  for (unsigned i = 0; i < DIM; i++)
310  {
311  // Get the value
312  const std::complex<double> u_value(
313  this->raw_nodal_value(l, u_nodal_index[2 * i + 0]),
314  this->raw_nodal_value(l, u_nodal_index[2 * i + 1]));
315 
316  // Loop over two coordinate directions (for derivatives)
317  for (unsigned j = 0; j < DIM; j++)
318  {
319  dudx[i][j] += u_value * dpsifdx(l, j);
320  }
321  }
322  }
323 
324  // Take the real part of the velocity gradient matrix
325  DenseMatrix<double> real_dudx(DIM);
326  if (real == 0)
327  {
328  cosomegat = 1.0;
329  sinomegat = 0.0;
330  }
331  else
332  {
333  cosomegat = 0.0;
334  sinomegat = 1.0;
335  }
336 
337  for (unsigned i = 0; i < DIM; ++i)
338  {
339  for (unsigned j = 0; j < DIM; ++j)
340  {
341  real_dudx(i, j) =
342  dudx[i][j].real() * cosomegat + dudx[i][j].imag() * sinomegat;
343  }
344  }
345 
346 
347  // Now set the strain rate
348  // Loop over veclocity components
349  for (unsigned i = 0; i < DIM; i++)
350  {
351  // Loop over derivative directions
352  for (unsigned j = 0; j < DIM; j++)
353  {
354  strainrate(i, j) = 0.5 * (real_dudx(i, j) + real_dudx(j, i));
355  }
356  }
357 
358  } // End of strain_rate
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
unsigned long nrow() const
Return the number of rows of the matrix.
Definition: matrices.h:485
unsigned long ncol() const
Return the number of columns of the matrix.
Definition: matrices.h:491
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3298
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
Definition: main.h:115

References DIM, oomph::FiniteElement::dshape_eulerian(), i, j, oomph::DenseMatrix< T >::ncol(), oomph::FiniteElement::nnode(), oomph::DenseMatrix< T >::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::FiniteElement::raw_nodal_value(), s, sqrt(), and u_index_linearised_nst().

Referenced by oomph::RefineableLinearisedNavierStokesEquations::get_Z2_flux().

◆ u_index_linearised_nst()

virtual unsigned oomph::LinearisedNavierStokesEquations::u_index_linearised_nst ( const unsigned i) const
inlinevirtual

Return the index at which the i-th unknown velocity component is stored. The default value, i, is appropriate for single-physics problems. In derived multi-physics elements, this function should be overloaded to reflect the chosen storage scheme. Note that these equations require that the unknowns are always stored at the same indices at each node.

381  {
382  return i;
383  }

References i.

Referenced by du_dt_linearised_nst(), fill_in_generic_residual_contribution_linearised_nst(), oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst(), oomph::RefineableLinearisedQCrouzeixRaviartElement::get_interpolated_values(), oomph::RefineableLinearisedQTaylorHoodElement::get_interpolated_values(), interpolated_u_linearised_nst(), output_veloc(), and strain_rate().

◆ unpin_real_or_imag()

virtual void oomph::LinearisedNavierStokesEquations::unpin_real_or_imag ( const unsigned real)
pure virtual

◆ viscosity_ratio()

const double& oomph::LinearisedNavierStokesEquations::viscosity_ratio ( ) const
inline

Viscosity ratio for element: element's viscosity relative to the viscosity used in the definition of the Reynolds number

330  {
331  return *Viscosity_Ratio_pt;
332  }

References Viscosity_Ratio_pt.

Referenced by fill_in_generic_residual_contribution_linearised_nst(), and oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst().

◆ viscosity_ratio_pt()

double*& oomph::LinearisedNavierStokesEquations::viscosity_ratio_pt ( )
inline

Pointer to the viscosity ratio.

336  {
337  return Viscosity_Ratio_pt;
338  }

References Viscosity_Ratio_pt.

Referenced by oomph::RefineableLinearisedNavierStokesEquations::further_build().

Member Data Documentation

◆ ALE_is_disabled

bool oomph::LinearisedNavierStokesEquations::ALE_is_disabled
protected

Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed. Only set to true if you're sure that the mesh is stationary.

Referenced by disable_ALE(), enable_ALE(), and oomph::RefineableLinearisedNavierStokesEquations::further_build().

◆ base_flow_dudx_fct_pt

void(*&)(const double& time, const Vector<double>& x, DenseMatrix<double>& f) oomph::LinearisedNavierStokesEquations::base_flow_dudx_fct_pt()
inline

Access function for the derivatives of the base flow w.r.t. global coordinates solution pointer

366  {
367  return Base_flow_dudx_fct_pt;
368  }

◆ Base_flow_dudx_fct_pt

void(* oomph::LinearisedNavierStokesEquations::Base_flow_dudx_fct_pt) (const double &time, const Vector< double > &x, DenseMatrix< double > &result)
protected

Pointer to derivatives of base flow solution velocity components w.r.t. global coordinates (r and z) function

Referenced by get_base_flow_dudx().

◆ base_flow_u_fct_pt

void(*&)(const double& time, const Vector<double>& x, Vector<double>& f) oomph::LinearisedNavierStokesEquations::base_flow_u_fct_pt()
inline

Access function for the base flow solution pointer.

357  {
358  return Base_flow_u_fct_pt;
359  }

◆ Base_flow_u_fct_pt

void(* oomph::LinearisedNavierStokesEquations::Base_flow_u_fct_pt) (const double &time, const Vector< double > &x, Vector< double > &result)
protected

Pointer to base flow solution (velocity components) function.

Referenced by get_base_flow_u().

◆ Data_number_of_eigenvalue

unsigned oomph::LinearisedNavierStokesEquations::Data_number_of_eigenvalue
protected

Index of datum where eigenvalue is stored.

Referenced by LinearisedNavierStokesEquations(), and set_eigenfunction_normalisation_element().

◆ Default_Physical_Constant_Value

double oomph::LinearisedNavierStokesEquations::Default_Physical_Constant_Value = 0.0
staticprivate

Static default value for the physical constants (all initialised to zero)

Referenced by LinearisedNavierStokesEquations().

◆ Default_Physical_Ratio_Value

double oomph::LinearisedNavierStokesEquations::Default_Physical_Ratio_Value = 1.0
staticprivate

Static default value for the physical ratios (all initialised to one)

Referenced by LinearisedNavierStokesEquations().

◆ Density_Ratio_pt

double* oomph::LinearisedNavierStokesEquations::Density_Ratio_pt
protected

Pointer to the density ratio (relative to the density used in the definition of the Reynolds number)

Referenced by density_ratio(), density_ratio_pt(), oomph::RefineableLinearisedNavierStokesEquations::further_build(), and LinearisedNavierStokesEquations().

◆ Gamma

Vector< double > oomph::LinearisedNavierStokesEquations::Gamma
static

Vector to decide whether the stress-divergence form is used or not.

Linearised axisymmetric Navier–Stokes equations static data.

Referenced by FlowAroundCylinderProblem< ELEMENT >::add_eigenproblem(), fill_in_generic_residual_contribution_linearised_nst(), and oomph::RefineableLinearisedNavierStokesEquations::fill_in_generic_residual_contribution_linearised_nst().

◆ Index_of_eigenvalue

unsigned oomph::LinearisedNavierStokesEquations::Index_of_eigenvalue
protected

◆ Lambda_pt

double* oomph::LinearisedNavierStokesEquations::Lambda_pt
protected

◆ Normalisation_element_pt

LinearisedNavierStokesEigenfunctionNormalisationElement* oomph::LinearisedNavierStokesEquations::Normalisation_element_pt
protected

◆ Omega_pt

double* oomph::LinearisedNavierStokesEquations::Omega_pt
protected

◆ Pressure_not_stored_at_node

int oomph::LinearisedNavierStokesEquations::Pressure_not_stored_at_node = -100
staticprivate

Static "magic" number that indicates that the pressure is not stored at a node

Referenced by p_index_linearised_nst().

◆ Re_pt

double* oomph::LinearisedNavierStokesEquations::Re_pt
protected

◆ ReSt_pt

double* oomph::LinearisedNavierStokesEquations::ReSt_pt
protected

Pointer to global Reynolds number x Strouhal number (=Womersley)

Referenced by oomph::RefineableLinearisedNavierStokesEquations::further_build(), LinearisedNavierStokesEquations(), re_st(), and re_st_pt().

◆ Viscosity_Ratio_pt

double* oomph::LinearisedNavierStokesEquations::Viscosity_Ratio_pt
protected

Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds number)

Referenced by oomph::RefineableLinearisedNavierStokesEquations::further_build(), LinearisedNavierStokesEquations(), viscosity_ratio(), and viscosity_ratio_pt().


The documentation for this class was generated from the following files: