oomph::LinearisedAxisymmetricNavierStokesEquations Class Referenceabstract

#include <linearised_axisym_navier_stokes_elements.h>

+ Inheritance diagram for oomph::LinearisedAxisymmetricNavierStokesEquations:

Public Member Functions

 LinearisedAxisymmetricNavierStokesEquations ()
 
const doublere () const
 Reynolds number. More...
 
const doublere_st () const
 Product of Reynolds and Strouhal number (=Womersley number) More...
 
const intazimuthal_mode_number () const
 Azimuthal mode number k in e^ik(theta) decomposition. More...
 
double *& re_pt ()
 Pointer to Reynolds number. More...
 
double *& re_st_pt ()
 Pointer to product of Reynolds and Strouhal number (=Womersley number) More...
 
int *& azimuthal_mode_number_pt ()
 Pointer to azimuthal mode number k in e^ik(theta) decomposition. 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_axi_nst () const =0
 
virtual unsigned u_index_linearised_axi_nst (const unsigned &i) const
 
double du_dt_linearised_axi_nst (const unsigned &n, const unsigned &i) const
 
void disable_ALE ()
 
void enable_ALE ()
 
virtual double p_linearised_axi_nst (const unsigned &n_p, const unsigned &i) const =0
 
virtual int p_index_linearised_axi_nst (const unsigned &i) const
 Which nodal value represents the pressure? More...
 
void strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate) 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...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
double interpolated_u_linearised_axi_nst (const Vector< double > &s, const unsigned &i) const
 
double interpolated_p_linearised_axi_nst (const Vector< double > &s, const unsigned &i) const
 
virtual void get_base_flow_u (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
 
 LinearisedAxisymmetricNavierStokesEquations ()
 
const doublere () const
 Reynolds number. More...
 
double *& re_pt ()
 Pointer to Reynolds number. More...
 
const doublere_st () const
 Product of Reynolds and Strouhal number (=Womersley number) More...
 
double *& re_st_pt ()
 Pointer to product of Reynolds and Strouhal number (=Womersley number) More...
 
const doublere_invfr () const
 Global inverse Froude number. More...
 
double *& re_invfr_pt ()
 Pointer to global inverse Froude number. More...
 
const doublere_invro () const
 Global Reynolds number multiplied by inverse Rossby number. More...
 
double *& re_invro_pt ()
 Pointer to global Reynolds number multiplied by inverse Rossby number. More...
 
const Vector< double > & g () const
 Vector of gravitational components. More...
 
Vector< double > *& g_pt ()
 Pointer to Vector of gravitational components. More...
 
const intazimuthal_mode_number () const
 Azimuthal mode number k in e^ik(theta) decomposition. More...
 
int *& azimuthal_mode_number_pt ()
 Pointer to azimuthal mode number k in e^ik(theta) decomposition. 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 int get_local_eqn_number_corresponding_to_geometric_dofs (const unsigned &n, const unsigned &i)=0
 
virtual unsigned npres_lin_axi_nst () const =0
 
virtual unsigned xhat_index_lin_axi_nst (const unsigned &i) const
 
virtual unsigned u_index_lin_axi_nst (const unsigned &i) const
 
double du_dt_lin_axi_nst (const unsigned &n, const unsigned &i) const
 
double dnodal_position_perturbation_dt_lin_axi_nst (const unsigned &n, const unsigned &i) const
 
unsigned nexternal_H_data ()
 Return the number of external perturbed spine "heights" data. More...
 
void disable_ALE ()
 
void enable_ALE ()
 
virtual double p_lin_axi_nst (const unsigned &n_p, const unsigned &i) const =0
 
virtual int p_index_lin_axi_nst (const unsigned &i) const
 Which nodal value represents the pressure? More...
 
void dkin_energy_dt (double &dkin_en_dt, double &kin_en) const
 Get integral of kinetic energy over element plus deriv w.r.t. time. More...
 
void strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate) 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...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
double interpolated_u_lin_axi_nst (const Vector< double > &s, const unsigned &i) const
 
double interpolated_p_lin_axi_nst (const Vector< double > &s, const unsigned &i) const
 
double interpolated_nodal_position_perturbation_lin_axi_nst (const Vector< double > &s, const unsigned &i) const
 
void assign_additional_local_eqn_numbers ()
 Define the local equation numbering schemes. More...
 
 LinearisedAxisymmetricNavierStokesEquations ()
 
const doublere () const
 Reynolds number. More...
 
const doublere_st () const
 Product of Reynolds and Strouhal number (=Womersley number) More...
 
const intazimuthal_mode_number () const
 Azimuthal mode number k in e^ik(theta) decomposition. More...
 
double *& re_pt ()
 Pointer to Reynolds number. More...
 
double *& re_st_pt ()
 Pointer to product of Reynolds and Strouhal number (=Womersley number) More...
 
int *& azimuthal_mode_number_pt ()
 Pointer to azimuthal mode number k in e^ik(theta) decomposition. 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_axi_nst () const =0
 
virtual unsigned u_index_linearised_axi_nst (const unsigned &i) const
 
double du_dt_linearised_axi_nst (const unsigned &n, const unsigned &i) const
 
void disable_ALE ()
 
void enable_ALE ()
 
virtual double p_linearised_axi_nst (const unsigned &n_p, const unsigned &i) const =0
 
virtual int p_index_linearised_axi_nst (const unsigned &i) const
 Which nodal value represents the pressure? More...
 
void strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate) 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...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
double interpolated_u_linearised_axi_nst (const Vector< double > &s, const unsigned &i) const
 
double interpolated_p_linearised_axi_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 ()
 
void(*&)(const double &time, const Vector< double > &x, Vector< double > &fbase_flow_dudt_fct_pt ()
 
void(*&)(const double &time, const Vector< double > &x, double &fbase_flow_p_fct_pt ()
 Access function for the base flow pressure pointer. More...
 
void(*&)(const double &time, const Vector< double > &x, RankFourTensor< double > &fbase_flow_d_dudx_dX_fct_pt ()
 
void(*&)(const double &time, const Vector< double > &x, Vector< double > &fbody_force_fct_pt ()
 Access function for the body-force pointer. More...
 
double(*&)(const double &time, const Vector< double > &xsource_fct_pt ()
 Access function for the source-function pointer. More...
 
void(*&)(const double &time, const Vector< double > &x, DenseMatrix< double > &fbase_flow_duds_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_axi_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_linearised_axi_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual void pshape_linearised_axi_nst (const Vector< double > &s, Shape &psi) const =0
 Compute the pressure shape functions at local coordinate s. More...
 
virtual void pshape_linearised_axi_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
 
virtual void fill_in_generic_residual_contribution_linearised_axi_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
 
virtual int p_local_eqn (const unsigned &n, const unsigned &i)=0
 
virtual double dshape_and_dtest_eulerian_lin_axi_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_lin_axi_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_and_dnodal_coordinates_at_knot_lin_axi_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, RankFourTensor< double > &d_dpsidx_dX, Shape &test, DShape &dtestdx, RankFourTensor< double > &d_dtestdx_dX, DenseMatrix< double > &djacobian_dX) const =0
 
virtual void pshape_lin_axi_nst (const Vector< double > &s, Shape &psi) const =0
 Compute the pressure shape functions at local coordinate s. More...
 
virtual void pshape_lin_axi_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_dudx (const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
 
virtual void get_base_flow_dudt (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
 
virtual void get_base_flow_p (const double &time, const unsigned &ipt, const Vector< double > &x, double &result) const
 
virtual void get_base_flow_d_dudx_dX (const double &time, const unsigned &ipt, const Vector< double > &x, RankFourTensor< double > &result) const
 
void get_body_force_base_flow (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result)
 
double get_source_base_flow (const double &time, const unsigned &ipt, const Vector< double > &x)
 
void get_body_force_gradient_base_flow (const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result)
 
void get_source_gradient_base_flow (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result)
 
virtual void get_base_flow_duds (const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
 
virtual void fill_in_generic_residual_contribution_lin_axi_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
 
virtual int p_local_eqn (const unsigned &n, const unsigned &i)=0
 
virtual double dshape_and_dtest_eulerian_linearised_axi_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_linearised_axi_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual void pshape_linearised_axi_nst (const Vector< double > &s, Shape &psi) const =0
 Compute the pressure shape functions at local coordinate s. More...
 
virtual void pshape_linearised_axi_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
 
virtual void fill_in_generic_residual_contribution_linearised_axi_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)
 
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)
 
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_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...
 
intAzimuthal_Mode_Number_pt
 Pointer to azimuthal mode number k in e^ik(theta) decomposition. More...
 
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
 
doubleReInvFr_pt
 
doubleReInvRo_pt
 
Vector< double > * G_pt
 Pointer to global gravity Vector. More...
 
void(* Base_flow_dudt_fct_pt )(const double &time, const Vector< double > &x, Vector< double > &result)
 
void(* Base_flow_p_fct_pt )(const double &time, const Vector< double > &x, double &result)
 Pointer to base flow solution (pressure) function. More...
 
void(* Base_flow_d_dudx_dX_fct_pt )(const double &time, const Vector< double > &x, RankFourTensor< double > &result)
 
void(* Body_force_fct_pt )(const double &time, const Vector< double > &x, Vector< double > &result)
 Pointer to (base flow) body force function. More...
 
double(* Source_fct_pt )(const double &time, const Vector< double > &x)
 Pointer to (base flow) volumetric source function. More...
 
void(* Base_flow_duds_fct_pt )(const double &time, const Vector< double > &x, DenseMatrix< double > &result)
 
Vector< intExternal_H_local_eqn
 
Vector< unsignedExternal_node
 
- 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
 
static double Default_Physical_Constant_Value
 
static int Default_Azimuthal_Mode_Number_Value
 Static default value for the azimuthal mode number (zero) More...
 
static double Default_Physical_Ratio_Value
 Static default value for the physical ratios (all initialised to one) More...
 
static Vector< doubleDefault_Gravity_Vector
 Static default value for the gravity vector (zero) 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 unsteady axisymmetric Navier–Stokes equations in cylindrical polar coordinates, \( x_0^* = r^*\) and \( x_1^* = z^* \) with \( \partial / \partial \theta = 0 \). We're solving for the radial, axial and azimuthal (swirl) velocities, \( u_0^* = u_r^*(r^*,z^*,t^*) = u^*(r^*,z^*,t^*), \ u_1^* = u_z^*(r^*,z^*,t^*) = w^*(r^*,z^*,t^*)\) and \( u_2^* = u_\theta^*(r^*,z^*,t^*) = v^*(r^*,z^*,t^*) \), respectively, and the pressure \( p(r^*,z^*,t^*) \).

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

◆ LinearisedAxisymmetricNavierStokesEquations() [1/3]

oomph::LinearisedAxisymmetricNavierStokesEquations::LinearisedAxisymmetricNavierStokesEquations ( )
inline

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

200  {
201  // Set all the physical parameter pointers to the default value of zero
204 
205  // Set the azimuthal mode number to default (zero)
207 
208  // Set the physical ratios to the default value of one
211  }
double * Re_pt
Pointer to global Reynolds number.
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:88
double * Density_Ratio_pt
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:85
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: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:97
static int Default_Azimuthal_Mode_Number_Value
Static default value for the azimuthal mode number (zero)
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:69
void(* Base_flow_dudx_fct_pt)(const double &time, const Vector< double > &x, DenseMatrix< double > &result)
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:103
int * Azimuthal_Mode_Number_pt
Pointer to azimuthal mode number k in e^ik(theta) decomposition.
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:94
bool ALE_is_disabled
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:110
double * Viscosity_Ratio_pt
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:81
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all initialised to one)
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:72
static double Default_Physical_Constant_Value
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:66
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:91

References Azimuthal_Mode_Number_pt, Default_Azimuthal_Mode_Number_Value, Default_Physical_Constant_Value, Default_Physical_Ratio_Value, Density_Ratio_pt, Re_pt, ReSt_pt, and Viscosity_Ratio_pt.

◆ LinearisedAxisymmetricNavierStokesEquations() [2/3]

oomph::LinearisedAxisymmetricNavierStokesEquations::LinearisedAxisymmetricNavierStokesEquations ( )
inline

Constructor: NULL the base flow solution and the derivatives of the base flow function, as well as the base flow body force and volumetric source function pointers

445  ALE_is_disabled(false)
446  {
447  // Set all the physical parameter pointers to the default value of zero
453 
454  // Set the azimuthal mode number to default (zero)
456 
457  // Set the physical ratios to the default value of one
460  }
double * ReInvFr_pt
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:91
void(* Base_flow_p_fct_pt)(const double &time, const Vector< double > &x, double &result)
Pointer to base flow solution (pressure) function.
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:121
void(* Base_flow_d_dudx_dX_fct_pt)(const double &time, const Vector< double > &x, RankFourTensor< double > &result)
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:127
void(* Base_flow_duds_fct_pt)(const double &time, const Vector< double > &x, DenseMatrix< double > &result)
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:142
Vector< double > * G_pt
Pointer to global gravity Vector.
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:98
double * ReInvRo_pt
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:95
double(* Source_fct_pt)(const double &time, const Vector< double > &x)
Pointer to (base flow) volumetric source function.
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:137
void(* Base_flow_dudt_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:116
static Vector< double > Default_Gravity_Vector
Static default value for the gravity vector (zero)
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:68
void(* Body_force_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to (base flow) body force function.
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:132

References Azimuthal_Mode_Number_pt, Default_Azimuthal_Mode_Number_Value, Default_Gravity_Vector, Default_Physical_Constant_Value, Default_Physical_Ratio_Value, Density_Ratio_pt, G_pt, Re_pt, ReInvFr_pt, ReInvRo_pt, ReSt_pt, and Viscosity_Ratio_pt.

◆ LinearisedAxisymmetricNavierStokesEquations() [3/3]

oomph::LinearisedAxisymmetricNavierStokesEquations::LinearisedAxisymmetricNavierStokesEquations ( )
inline

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

201  {
202  // Set all the physical parameter pointers to the default value of zero
205 
206  // Set the azimuthal mode number to default (zero)
208 
209  // Set the physical ratios to the default value of one
212  }

References Azimuthal_Mode_Number_pt, Default_Azimuthal_Mode_Number_Value, Default_Physical_Constant_Value, Default_Physical_Ratio_Value, Density_Ratio_pt, Re_pt, ReSt_pt, and Viscosity_Ratio_pt.

Member Function Documentation

◆ assign_additional_local_eqn_numbers()

void oomph::LinearisedAxisymmetricNavierStokesEquations::assign_additional_local_eqn_numbers ( )
inlinevirtual

Define the local equation numbering schemes.

Reimplemented from oomph::GeneralisedElement.

873  {
874  // Determine the number of external degrees of freedom
875  const unsigned n_external_H = nexternal_H_data();
876 
877  // Resize the external degree of freedom counter
878  External_H_local_eqn.resize(n_external_H);
879 
880  // Loop over the external degrees of freedom
881  for(unsigned e=0;e<n_external_H;e++)
882  {
884  }
885  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
int external_local_eqn(const unsigned &i, const unsigned &j)
Definition: elements.h:311
unsigned nexternal_H_data()
Return the number of external perturbed spine "heights" data.
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:685
Vector< int > External_H_local_eqn
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:422

References e(), External_H_local_eqn, oomph::GeneralisedElement::external_local_eqn(), and nexternal_H_data().

◆ azimuthal_mode_number() [1/3]

const int& oomph::LinearisedAxisymmetricNavierStokesEquations::azimuthal_mode_number ( ) const
inline

◆ azimuthal_mode_number() [2/3]

const int& oomph::LinearisedAxisymmetricNavierStokesEquations::azimuthal_mode_number ( ) const
inline

Azimuthal mode number k in e^ik(theta) decomposition.

503  {
504  return *Azimuthal_Mode_Number_pt;
505  }

References Azimuthal_Mode_Number_pt.

◆ azimuthal_mode_number() [3/3]

const int& oomph::LinearisedAxisymmetricNavierStokesEquations::azimuthal_mode_number ( ) const
inline

Azimuthal mode number k in e^ik(theta) decomposition.

237  {
238  return *Azimuthal_Mode_Number_pt;
239  }

References Azimuthal_Mode_Number_pt.

◆ azimuthal_mode_number_pt() [1/3]

int* & oomph::LinearisedAxisymmetricNavierStokesEquations::azimuthal_mode_number_pt ( )
inline

Pointer to azimuthal mode number k in e^ik(theta) decomposition.

241 { return Azimuthal_Mode_Number_pt; }

References Azimuthal_Mode_Number_pt.

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

◆ azimuthal_mode_number_pt() [2/3]

int* & oomph::LinearisedAxisymmetricNavierStokesEquations::azimuthal_mode_number_pt ( )
inline

Pointer to azimuthal mode number k in e^ik(theta) decomposition.

508 { return Azimuthal_Mode_Number_pt; }

References Azimuthal_Mode_Number_pt.

◆ azimuthal_mode_number_pt() [3/3]

int*& oomph::LinearisedAxisymmetricNavierStokesEquations::azimuthal_mode_number_pt ( )
inline

Pointer to azimuthal mode number k in e^ik(theta) decomposition.

255  {
257  }

References Azimuthal_Mode_Number_pt.

◆ density_ratio() [1/3]

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

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

252 { return *Density_Ratio_pt; }

References Density_Ratio_pt.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst(), fill_in_generic_residual_contribution_linearised_axi_nst(), and oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_nst().

◆ density_ratio() [2/3]

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

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

519 { return *Density_Ratio_pt; }

References Density_Ratio_pt.

◆ density_ratio() [3/3]

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

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

275  {
276  return *Density_Ratio_pt;
277  }

References Density_Ratio_pt.

◆ density_ratio_pt() [1/3]

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

Pointer to the density ratio.

255 { return Density_Ratio_pt; }

References Density_Ratio_pt.

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

◆ density_ratio_pt() [2/3]

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

Pointer to the density ratio.

522 { return Density_Ratio_pt; }

References Density_Ratio_pt.

◆ density_ratio_pt() [3/3]

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

Pointer to the density ratio.

281  {
282  return Density_Ratio_pt;
283  }

References Density_Ratio_pt.

◆ disable_ALE() [1/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::disable_ALE ( )
inlinevirtual

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

Reimplemented from oomph::FiniteElement.

318 { ALE_is_disabled = true; }

References ALE_is_disabled.

◆ disable_ALE() [2/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::disable_ALE ( )
inlinevirtual

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

Reimplemented from oomph::FiniteElement.

689 { ALE_is_disabled = true; }

References ALE_is_disabled.

◆ disable_ALE() [3/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::disable_ALE ( )
inlinevirtual

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

Reimplemented from oomph::FiniteElement.

350  {
351  ALE_is_disabled = true;
352  }

References ALE_is_disabled.

◆ dkin_energy_dt()

void oomph::LinearisedAxisymmetricNavierStokesEquations::dkin_energy_dt ( double dkin_en_dt,
double kin_en 
) const

Get integral of kinetic energy over element plus deriv w.r.t. time.

Get integral of kinetic energy over element. Also return the derivative of the integral of the kinetic energy w.r.t. time. Note that this is the "raw" kinetic energy in the sense that the density ratio has not been included. In problems with two or more fluids the user will have to remember to premultiply certain elements by the appropriate density ratio. ratio.

407  {
408  // Initialise kinetic energy and its deriv w.r.t. time
409  kin_en = 0.0; dkin_en_dt = 0.0;
410 
411  // Determine number of nodes in the element
412  const unsigned n_node = nnode();
413 
414  // Set up memory for the fluid (f) shape functions and their derivatives
415  // w.r.t. local coordinates (s).
416  Shape psif(n_node);
417  DShape dpsifds(n_node,2);
418 
419  // Set the Vector to hold local coordinates
420  Vector<double> s(2);
421 
422  // Get the nodal indices at which the velocity is stored
423  unsigned u_nodal_index[6];
424  for(unsigned i=0;i<6;++i) { u_nodal_index[i] = u_index_lin_axi_nst(i); }
425 
426  // Determine number of integration points
427  const unsigned n_intpt = integral_pt()->nweight();
428 
429  // Loop over the integration points
430  for(unsigned ipt=0;ipt<n_intpt;ipt++)
431  {
432  // Compute the local coordinates s of the integration point
433  for(unsigned i=0;i<2;i++) { s[i] = integral_pt()->knot(ipt,i); }
434 
435  // Get the integral weight
436  const double w = integral_pt()->weight(ipt);
437 
438  // Calculate the derivatives of the fluid shape functions w.r.t. the
439  // local coordinates
440  this->dshape_local_at_knot(ipt,psif,dpsifds);
441 
442  // Get Jacobian of mapping
443  const double J = J_eulerian(s);
444 
445  // Allocate storage for the r-position and its deriv w.r.t. time
446  double interpolated_r = 0.0;
447  double interpolated_drdt = 0.0;
448 
449  // Allocate storage for the derivatives of the positions
450  // w.r.t. local coordinates (s_1 and s_2)
451  DenseMatrix<double> interpolated_dxds(2,2,0.0);
452 
453  // Allocate storage for the derivative w.r.t. time of the spatial
454  // derivatives of the positions
455  DenseMatrix<double> interpolated_d_dxds_dt(2,2,0.0);
456 
457  // Allocate storage for the velocity components (six of these)
458  // and their derivatives w.r.t. time
459  Vector<double> interpolated_u(6,0.0);
460  Vector<double> dudt(6,0.0);
461 
462  // Loop over the element's nodes
463  for(unsigned l=0;l<n_node;l++)
464  {
465  // Cache the shape function
466  const double psif_ = psif(l);
467 
468  // Loop over the two coordinate directions
469  for(unsigned i=0;i<2;i++)
470  {
471  // Loop over the two coordinate directions (for derivatives)
472  for(unsigned j=0;j<2;j++)
473  {
474  interpolated_dxds(i,j) += this->nodal_position(l,i)*dpsifds(l,j);
475 
476  interpolated_d_dxds_dt(i,j) +=
477  this->dnodal_position_dt(l,i)*dpsifds(l,j);
478  }
479  }
480 
481  // Calculate the r-position
482  interpolated_r += this->nodal_position(l,0)*psif_;
483 
484  // Calculate the derivative of the r-position w.r.t. time
485  interpolated_drdt += this->dnodal_position_dt(l,0)*psif_;
486 
487  // Loop over the six velocity components
488  for(unsigned i=0;i<6;i++)
489  {
490  // Get the value
491  const double u_value = this->nodal_value(l,u_nodal_index[i]);
492 
493  // Add contribution
494  interpolated_u[i] += u_value*psif_;
495 
496  // Add contribution to dudt
497  dudt[i] += du_dt_lin_axi_nst(l,i)*psif_;
498  }
499  } // End of loop over the element's nodes
500 
501  // Compute sum of square of velocity components and sum of product of
502  // velocity components and their time derivatives
503  double veloc_squared = 0.0;
504  double veloc_multiplied_by_time_deriv = 0.0;
505  for(unsigned i=0;i<6;i++)
506  {
507  veloc_squared += interpolated_u[i]*interpolated_u[i];
508  veloc_multiplied_by_time_deriv += interpolated_u[i]*dudt[i];
509  }
510 
511  // Compute the derivative of the Jacobian of the mapping w.r.t. time
512  const double dJdt = interpolated_d_dxds_dt(0,0)*interpolated_dxds(1,1)
513  + interpolated_d_dxds_dt(1,1)*interpolated_dxds(0,0)
514  + interpolated_d_dxds_dt(1,0)*interpolated_dxds(0,1)
515  + interpolated_d_dxds_dt(0,1)*interpolated_dxds(1,0);
516 
517  // Add contribution to kinetic energy (no density ratio)
518  kin_en += veloc_squared*interpolated_r*J*w;
519 
520  // Add contributions to deriv of kinetic energy w.r.t. time
521  dkin_en_dt += 2.0*veloc_multiplied_by_time_deriv*interpolated_r*J*w;
522  dkin_en_dt += veloc_squared*interpolated_drdt*J*w;
523  dkin_en_dt += veloc_squared*interpolated_r*dJdt*w;
524  }
525  } // End of dkin_energy_dt
int i
Definition: BiCGSTAB_step_by_step.cpp:9
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Definition: elements.cc:3239
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 nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:2317
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.
Definition: elements.h:2333
virtual double J_eulerian(const Vector< double > &s) const
Definition: elements.cc:4103
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.
virtual unsigned u_index_lin_axi_nst(const unsigned &i) const
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:619
double du_dt_lin_axi_nst(const unsigned &n, const unsigned &i) const
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:624
RealScalar s
Definition: level1_cplx_impl.h:130
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::FiniteElement::dnodal_position_dt(), oomph::FiniteElement::dshape_local_at_knot(), du_dt_lin_axi_nst(), i, oomph::FiniteElement::integral_pt(), J, j, oomph::FiniteElement::J_eulerian(), oomph::Integral::knot(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_position(), oomph::FiniteElement::nodal_value(), oomph::Integral::nweight(), s, u_index_lin_axi_nst(), w, and oomph::Integral::weight().

◆ dnodal_position_perturbation_dt_lin_axi_nst()

double oomph::LinearisedAxisymmetricNavierStokesEquations::dnodal_position_perturbation_dt_lin_axi_nst ( const unsigned n,
const unsigned i 
) const
inline

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

655  {
656  // Get the node's positional timestepper
657  TimeStepper* time_stepper_pt =
658  this->node_pt(n)->position_time_stepper_pt();
659 
660  // Initialise dxhat/dt
661  double dnodal_xhat_dt = 0.0;
662 
663  // Loop over the timesteps, if there is a non-steady timestepper
664  if (!time_stepper_pt->is_steady())
665  {
666  // Get the index at which the perturbation to the nodal position
667  // is stored
668  const unsigned xhat_nodal_index = xhat_index_lin_axi_nst(i);
669 
670  // Determine number of timsteps (past & present)
671  const unsigned n_time = time_stepper_pt->ntstorage();
672 
673  // Add the contributions to the time derivative
674  for(unsigned t=0;t<n_time;t++)
675  {
676  dnodal_xhat_dt +=
677  time_stepper_pt->weight(1,t)*nodal_value(t,n,xhat_nodal_index);
678  }
679  }
680 
681  return dnodal_xhat_dt;
682  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
virtual unsigned xhat_index_lin_axi_nst(const unsigned &i) const
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:609
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition: nodes.h:1022
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(), oomph::Node::position_time_stepper_pt(), plotPSD::t, oomph::GeomObject::time_stepper_pt(), oomph::TimeStepper::weight(), and xhat_index_lin_axi_nst().

Referenced by fill_in_generic_residual_contribution_lin_axi_nst().

◆ dshape_and_dtest_eulerian_and_dnodal_coordinates_at_knot_lin_axi_nst()

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::dshape_and_dtest_eulerian_and_dnodal_coordinates_at_knot_lin_axi_nst ( const unsigned ipt,
Shape psi,
DShape dpsidx,
RankFourTensor< double > &  d_dpsidx_dX,
Shape test,
DShape dtestdx,
RankFourTensor< double > &  d_dtestdx_dX,
DenseMatrix< double > &  djacobian_dX 
) const
protectedpure virtual

Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of mapping (J). Also compute derivatives of dpsidx, dtestdx and J w.r.t. nodal coordinates.

Implemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ dshape_and_dtest_eulerian_at_knot_lin_axi_nst()

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::dshape_and_dtest_eulerian_at_knot_lin_axi_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::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst().

◆ dshape_and_dtest_eulerian_at_knot_linearised_axi_nst() [1/2]

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

◆ dshape_and_dtest_eulerian_at_knot_linearised_axi_nst() [2/2]

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::dshape_and_dtest_eulerian_at_knot_linearised_axi_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::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ dshape_and_dtest_eulerian_lin_axi_nst()

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::dshape_and_dtest_eulerian_lin_axi_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::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ dshape_and_dtest_eulerian_linearised_axi_nst() [1/2]

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::dshape_and_dtest_eulerian_linearised_axi_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::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ dshape_and_dtest_eulerian_linearised_axi_nst() [2/2]

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::dshape_and_dtest_eulerian_linearised_axi_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::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ du_dt_lin_axi_nst()

double oomph::LinearisedAxisymmetricNavierStokesEquations::du_dt_lin_axi_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.

625  {
626  // Get the data's timestepper
627  TimeStepper* time_stepper_pt = this->node_pt(n)->time_stepper_pt();
628 
629  // Initialise dudt
630  double dudt = 0.0;
631 
632  // Loop over the timesteps, if there is a non-steady timestepper
633  if (!time_stepper_pt->is_steady())
634  {
635  // Get the index at which the velocity is stored
636  const unsigned u_nodal_index = u_index_lin_axi_nst(i);
637 
638  // Determine number of timsteps (past & present)
639  const unsigned n_time = time_stepper_pt->ntstorage();
640 
641  // Add the contributions to the time derivative
642  for(unsigned t=0;t<n_time;t++)
643  {
644  dudt += time_stepper_pt->weight(1,t)*nodal_value(t,n,u_nodal_index);
645  }
646  }
647 
648  return dudt;
649  }
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238

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_lin_axi_nst(), and oomph::TimeStepper::weight().

Referenced by dkin_energy_dt(), and fill_in_generic_residual_contribution_lin_axi_nst().

◆ du_dt_linearised_axi_nst() [1/2]

double oomph::LinearisedAxisymmetricNavierStokesEquations::du_dt_linearised_axi_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.

290  {
291  // Get the data's timestepper
292  TimeStepper* time_stepper_pt = this->node_pt(n)->time_stepper_pt();
293 
294  // Initialise dudt
295  double dudt = 0.0;
296 
297  // Loop over the timesteps, if there is a non-steady timestepper
298  if (!time_stepper_pt->is_steady())
299  {
300  // Get the index at which the velocity is stored
301  const unsigned u_nodal_index = u_index_linearised_axi_nst(i);
302 
303  // Determine number of timsteps (past & present)
304  const unsigned n_time = time_stepper_pt->ntstorage();
305 
306  // Add the contributions to the time derivative
307  for(unsigned t=0;t<n_time;t++)
308  {
309  dudt += time_stepper_pt->weight(1,t)*nodal_value(t,n,u_nodal_index);
310  }
311  }
312 
313  return dudt;
314  }
virtual unsigned u_index_linearised_axi_nst(const unsigned &i) const
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:284

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_axi_nst(), and oomph::TimeStepper::weight().

Referenced by fill_in_generic_residual_contribution_linearised_axi_nst(), and oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_nst().

◆ du_dt_linearised_axi_nst() [2/2]

double oomph::LinearisedAxisymmetricNavierStokesEquations::du_dt_linearised_axi_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.

320  {
321  // Get the data's timestepper
322  TimeStepper* time_stepper_pt = this->node_pt(n)->time_stepper_pt();
323 
324  // Initialise dudt
325  double dudt = 0.0;
326 
327  // Loop over the timesteps, if there is a non-steady timestepper
328  if (!time_stepper_pt->is_steady())
329  {
330  // Get the index at which the velocity is stored
331  const unsigned u_nodal_index = u_index_linearised_axi_nst(i);
332 
333  // Determine number of timsteps (past & present)
334  const unsigned n_time = time_stepper_pt->ntstorage();
335 
336  // Add the contributions to the time derivative
337  for (unsigned t = 0; t < n_time; t++)
338  {
339  dudt +=
340  time_stepper_pt->weight(1, t) * nodal_value(t, n, u_nodal_index);
341  }
342  }
343 
344  return dudt;
345  }

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_axi_nst(), and oomph::TimeStepper::weight().

◆ enable_ALE() [1/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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.

324 { ALE_is_disabled = false; }

References ALE_is_disabled.

◆ enable_ALE() [2/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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.

695 { ALE_is_disabled = false; }

References ALE_is_disabled.

◆ enable_ALE() [3/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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.

359  {
360  ALE_is_disabled = false;
361  }

References ALE_is_disabled.

◆ fill_in_contribution_to_jacobian() [1/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlinevirtual

Compute the element's residual Vector and the jacobian matrix. Virtual function can be overloaded by hanging-node version.

Reimplemented from oomph::GeneralisedElement.

Reimplemented in RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, LinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, and LinearisedAxisymmetricQTaylorHoodMultiDomainElement.

388  {
389  // Call the generic routine with the flag set to 1
391  residuals,jacobian,GeneralisedElement::Dummy_matrix,1);
392  }
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227
virtual void fill_in_generic_residual_contribution_linearised_axi_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.cc:467

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

Referenced by LinearisedAxisymmetricQTaylorHoodMultiDomainElement::fill_in_contribution_to_jacobian(), LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement::fill_in_contribution_to_jacobian(), RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement::fill_in_contribution_to_jacobian(), and RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement::fill_in_contribution_to_jacobian().

◆ fill_in_contribution_to_jacobian() [2/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlinevirtual

Compute the element's residual Vector and the jacobian matrix. Virtual function can be overloaded by hanging-node version.

Reimplemented from oomph::GeneralisedElement.

Reimplemented in RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, LinearisedAxisymmetricQTaylorHoodMultiDomainElement, and LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement.

766  {
767  // Call the generic routine with the flag set to 1
769  residuals,jacobian,GeneralisedElement::Dummy_matrix,1);
770  }
virtual void fill_in_generic_residual_contribution_lin_axi_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.cc:535

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

◆ fill_in_contribution_to_jacobian() [3/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlinevirtual

Compute the element's residual Vector and the jacobian matrix. Virtual function can be overloaded by hanging-node version.

Reimplemented from oomph::FiniteElement.

Reimplemented in RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, and LinearisedAxisymmetricQTaylorHoodMultiDomainElement.

429  {
430  // Call the generic routine with the flag set to 1
432  residuals, jacobian, GeneralisedElement::Dummy_matrix, 1);
433  }

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

◆ fill_in_contribution_to_jacobian_and_mass_matrix() [1/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_contribution_to_jacobian_and_mass_matrix ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix 
)
inlinevirtual

Add the element's contribution to its residuals vector, jacobian matrix and mass matrix

Reimplemented from oomph::GeneralisedElement.

399  {
400  // Call the generic routine with the flag set to 2
402  residuals,jacobian,mass_matrix,2);
403  }

References fill_in_generic_residual_contribution_linearised_axi_nst().

◆ fill_in_contribution_to_jacobian_and_mass_matrix() [2/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_contribution_to_jacobian_and_mass_matrix ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix 
)
inlinevirtual

Add the element's contribution to its residuals vector, jacobian matrix and mass matrix

Reimplemented from oomph::GeneralisedElement.

777  {
778  // Call the generic routine with the flag set to 2
780  residuals,jacobian,mass_matrix,2);
781  }

References fill_in_generic_residual_contribution_lin_axi_nst().

◆ fill_in_contribution_to_jacobian_and_mass_matrix() [3/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_contribution_to_jacobian_and_mass_matrix ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix 
)
inlinevirtual

Add the element's contribution to its residuals vector, jacobian matrix and mass matrix

Reimplemented from oomph::GeneralisedElement.

441  {
442  // Call the generic routine with the flag set to 2
444  residuals, jacobian, mass_matrix, 2);
445  }

References fill_in_generic_residual_contribution_linearised_axi_nst().

◆ fill_in_contribution_to_residuals() [1/3]

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

Compute the element's residual Vector.

Reimplemented from oomph::GeneralisedElement.

375  {
376  // Call the generic residuals function with flag set to 0
377  // and using a dummy matrix argument
379  residuals,
382  }

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

◆ fill_in_contribution_to_residuals() [2/3]

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

Compute the element's residual Vector.

Reimplemented from oomph::GeneralisedElement.

753  {
754  // Call the generic residuals function with flag set to 0
755  // and using a dummy matrix argument
757  residuals,
760  }

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

◆ fill_in_contribution_to_residuals() [3/3]

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

Compute the element's residual Vector.

Reimplemented from oomph::GeneralisedElement.

415  {
416  // Call the generic residuals function with flag set to 0
417  // and using a dummy matrix argument
419  residuals,
422  0);
423  }

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

◆ fill_in_generic_residual_contribution_lin_axi_nst()

void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_lin_axi_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.

540  {
541  // Get the time from the first node in the element
542  const double time = this->node_pt(0)->time_stepper_pt()->time();
543 
544  // Determine number of nodes in the element
545  const unsigned n_node = nnode();
546 
547  // Determine number of nodes along one edge
548  const unsigned n_p = nnode_1d();
549 
550  // Determine how many pressure values there are associated with
551  // a single pressure component
552  const unsigned n_pres = npres_lin_axi_nst();
553 
554  // Get the nodal indices at which the velocity is stored
555  unsigned u_nodal_index[6];
556  for(unsigned i=0;i<6;++i)
557  {
558  u_nodal_index[i] = u_index_lin_axi_nst(i);
559  }
560 
561  // Get the nodal indices at which the perturbations to the nodal
562  // positions are stored
563  unsigned xhat_nodal_index[4];
564  for(unsigned i=0;i<4;++i)
565  {
566  xhat_nodal_index[i] = xhat_index_lin_axi_nst(i);
567  }
568 
569  // Set up memory for the fluid shape and test functions
570  // Note that there are two spatial dimensions, r and z, in this problem
571  Shape psif(n_node), testf(n_node);
572  DShape dpsifds(n_node,2), dpsifdx(n_node,2);
573  DShape dtestfds(n_node,2), dtestfdx(n_node,2);
574 
575  // Set up memory for the pressure (p) shape and test functions
576  Shape psip(n_pres), testp(n_pres);
577 
578  // Determine number of integration points
579  const unsigned n_intpt = integral_pt()->nweight();
580 
581  // Set up memory for the vector to hold local coordinates (two dimensions)
582  Vector<double> s(2);
583 
584  // Get physical variables from the element
585  // (Reynolds number must be multiplied by the density ratio)
586  const double scaled_re = re()*density_ratio();
587  const double scaled_re_st = re_st()*density_ratio();
588  const double scaled_re_inv_fr = re_invfr()*density_ratio();
589  const double visc_ratio = viscosity_ratio();
590  const Vector<double> G = g();
591  const int k = azimuthal_mode_number();
592 
593  // Integers used to store the local equation and unknown numbers
594  int local_eqn = 0, local_unknown = 0;
595 
596  // Loop over the integration points
597  for(unsigned ipt=0;ipt<n_intpt;ipt++)
598  {
599  // Assign values of the local coordinates s
600  for(unsigned i=0;i<2;i++) { s[i] = integral_pt()->knot(ipt,i); }
601 
602  // Get the integral weight
603  const double w = integral_pt()->weight(ipt);
604 
605  // Calculate the derivatives of the fluid shape functions w.r.t. the
606  // local coordinates
607  this->dshape_local_at_knot(ipt,psif,dpsifds);
608 
609  // Set the derivatives of the test functions w.r.t. local coords
610  // equal to that of the shape functions
611  dtestfds = dpsifds;
612 
613  // Calculate the fluid shape and test functions, and their derivatives
614  // w.r.t. the global coordinates
615  const double Jbar =
617  testf,dtestfdx);
618 
619  // Calculate the pressure shape and test functions
620  pshape_lin_axi_nst(s,psip,testp);
621 
622  // Allocate storage for the position and the derivative of the
623  // mesh positions w.r.t. time
624  Vector<double> interpolated_x(2,0.0);
625  Vector<double> mesh_velocity(2,0.0);
626 
627  // Allocate storage for the derivatives of the unperturbed positions
628  // w.r.t. local coordinates (s_1 and s_2)
629  DenseMatrix<double> interpolated_dxbar_ds(2,2,0.0);
630 
631  // Allocate storage for the perturbed position xhat
632  Vector<double> interpolated_xhat(4,0.0);
633 
634  // Allocate storage for the derivative of the perturbed position
635  // w.r.t. time
636  Vector<double> dxhat_dt(4,0.0);
637 
638  // Allocate storage for the derivatives of the perturbed positions
639  // w.r.t. local coordinates (s_1 and s_2)
640  DenseMatrix<double> interpolated_dxhat_ds(4,2,0.0);
641 
642  // Allocate storage for the velocity components (six of these)
643  // and their derivatives w.r.t. time
644  Vector<double> interpolated_u(6,0.0);
645  Vector<double> dudt(6,0.0);
646 
647  // Allocate storage for the pressure components (two of these)
648  Vector<double> interpolated_p(2,0.0);
649 
650  // Allocate storage for the derivatives of the velocity components
651  // w.r.t. local coordinates (s_1 and s_2)
652  DenseMatrix<double> interpolated_duds(6,2,0.0);
653 
654  // Calculate pressure at the integration point
655  // -------------------------------------------
656 
657  // Loop over pressure degrees of freedom (associated with a single
658  // pressure component) in the element
659  for(unsigned l=0;l<n_pres;l++)
660  {
661  // Cache the shape function
662  const double psip_ = psip(l);
663 
664  // Loop over the two pressure components
665  for(unsigned i=0;i<2;i++)
666  {
667  // Get the value
668  const double p_value = this->p_lin_axi_nst(l,i);
669 
670  // Add contribution
671  interpolated_p[i] += p_value*psip_;
672  }
673  } // End of loop over the pressure degrees of freedom in the element
674 
675  // Calculate eulerian positions, perturbations to these positions,
676  // ---------------------------------------------------------------
677  // velocities and their derivatives at the integration point
678  // ---------------------------------------------------------
679 
680  // Loop over the element's nodes
681  for(unsigned l=0;l<n_node;l++)
682  {
683  // Cache the shape function
684  const double psif_ = psif(l);
685 
686  // Loop over the two coordinate directions
687  for(unsigned i=0;i<2;i++)
688  {
689  // Calculate the unperturbed position xbar
690  interpolated_x[i] += this->raw_nodal_position(l,i)*psif_;
691 
692  // Loop over the two coordinate directions (for derivatives)
693  for(unsigned j=0;j<2;j++)
694  {
695  interpolated_dxbar_ds(i,j) +=
696  this->raw_nodal_position(l,i)*dpsifds(l,j);
697  }
698  }
699 
700  // Loop over the four position perturbations R_k^C, R_k^S, Z_k^C, Z_k^S
701  for(unsigned i=0;i<4;i++)
702  {
703  // Get the value
704  const double xhat_value = this->raw_nodal_value(l,xhat_nodal_index[i]);
705 
706  // Add contribution
707  interpolated_xhat[i] += xhat_value*psif_;
708 
709  // Loop over the two coordinate directions (for derivatives)
710  for(unsigned j=0;j<2;j++)
711  {
712  interpolated_dxhat_ds(i,j) += xhat_value*dpsifds(l,j);
713  }
714  }
715 
716  // Loop over the six velocity components
717  for(unsigned i=0;i<6;i++)
718  {
719  // Get the value
720  const double u_value = this->raw_nodal_value(l,u_nodal_index[i]);
721 
722  // Add contribution
723  interpolated_u[i] += u_value*psif_;
724 
725  // Add contribution to dudt
726  dudt[i] += du_dt_lin_axi_nst(l,i)*psif_;
727 
728  // Loop over the two coordinate directions (for derivatives)
729  for(unsigned j=0;j<2;j++)
730  {
731  interpolated_duds(i,j) += u_value*dpsifds(l,j);
732  }
733  }
734  } // End of loop over the element's nodes
735 
736  // Get the mesh velocity if ALE is enabled
737  if(!ALE_is_disabled)
738  {
739  // Loop over the element's nodes
740  for(unsigned l=0;l<n_node;l++)
741  {
742  // Loop over the two coordinate directions
743  for(unsigned i=0;i<2;i++)
744  {
745  // Calculate the derivative of the unperturbed position xbar
746  // w.r.t. time
747  mesh_velocity[i] += this->raw_dnodal_position_dt(l,i)*psif(l);
748  }
749 
750  // Loop over the four perturbed positions R_k^C, R_k^S, Z_k^C, Z_k^S
751  for(unsigned i=0;i<4;i++)
752  {
753  // Calculate the derivative of the perturbed position xhat
754  // w.r.t. time
755  dxhat_dt[i] +=
757  *psif(l);
758  }
759  }
760  }
761 
762  // Compute the cosine part of the perturbed jacobian at this ipt
763  const double JhatC =
764  interpolated_dxbar_ds(0,0)*interpolated_dxhat_ds(2,1)
765  + interpolated_dxbar_ds(1,1)*interpolated_dxhat_ds(0,0)
766  - interpolated_dxbar_ds(0,1)*interpolated_dxhat_ds(2,0)
767  - interpolated_dxbar_ds(1,0)*interpolated_dxhat_ds(0,1);
768 
769  // Compute the sine part of the perturbed jacobian at this ipt
770  const double JhatS =
771  interpolated_dxbar_ds(0,0)*interpolated_dxhat_ds(3,1)
772  + interpolated_dxbar_ds(1,1)*interpolated_dxhat_ds(1,0)
773  - interpolated_dxbar_ds(0,1)*interpolated_dxhat_ds(3,0)
774  - interpolated_dxbar_ds(1,0)*interpolated_dxhat_ds(1,1);
775 
776  // Determine the inverse of the unperturbed jacobian
777  const double invJbar = 1.0/Jbar;
778 
779  // Get the user-defined (base flow) body force terms
780  Vector<double> body_force(3);
782 
783  // Get the user-defined (base flow) source function
784  const double source = get_source_base_flow(time,ipt,interpolated_x);
785 
786  // Get velocities and their derivatives from base flow problem
787  // -----------------------------------------------------------
788 
789  // Allocate storage for the velocity components of the base state
790  // solution (initialise to zero)
791  Vector<double> base_flow_u(3,0.0);
792 
793  // Get the base state solution velocity components
794  get_base_flow_u(time,ipt,interpolated_x,base_flow_u);
795 
796  // Allocate storage for the derivatives of the base state solution's
797  // velocity components w.r.t. local coordinates (s_1 and s_2) and
798  // global coordinates (r and z)
799  // N.B. the derivatives of the base flow components w.r.t. the
800  // azimuthal coordinate direction (theta) are always zero since the
801  // base flow is axisymmetric
802  DenseMatrix<double> base_flow_duds(3,2,0.0);
803  DenseMatrix<double> base_flow_dudx(3,2,0.0);
804 
805  // Get the derivatives of the base state solution
806  // velocity components w.r.t. local and global coordinates
807  get_base_flow_duds(time,ipt,interpolated_x,base_flow_duds);
808  get_base_flow_dudx(time,ipt,interpolated_x,base_flow_dudx);
809 
810  // Allocate storage for the base state pressure at the current
811  // integration point
812  double base_flow_p = 0.0;
813 
814  // Allocate storage for the derivatives of the base state solution
815  // velocity components w.r.t. time
816  Vector<double> base_flow_dudt(3,0.0);
817 
818  // If ALE is enabled, get the base state pressure and the derivatives
819  // of the base state velocity w.r.t. time (only needed in this case)
820  if(!ALE_is_disabled)
821  {
822  get_base_flow_p(time,ipt,interpolated_x,base_flow_p);
823  get_base_flow_dudt(time,ipt,interpolated_x,base_flow_dudt);
824  }
825 
826  // Compute the following quantities
827  const double interpolated_dUdRC =
828  invJbar*(interpolated_dxbar_ds(1,1)*interpolated_duds(0,0)
829  + base_flow_duds(0,0)*interpolated_dxhat_ds(2,1)
830  - interpolated_dxbar_ds(1,0)*interpolated_duds(0,1)
831  - base_flow_duds(0,1)*interpolated_dxhat_ds(2,0));
832  const double interpolated_dUdRS =
833  invJbar*(interpolated_dxbar_ds(1,1)*interpolated_duds(1,0)
834  + base_flow_duds(0,0)*interpolated_dxhat_ds(3,1)
835  - interpolated_dxbar_ds(1,0)*interpolated_duds(1,1)
836  - base_flow_duds(0,1)*interpolated_dxhat_ds(3,0));
837  const double interpolated_dWdRC =
838  invJbar*(interpolated_dxbar_ds(1,1)*interpolated_duds(2,0)
839  + base_flow_duds(1,0)*interpolated_dxhat_ds(2,1)
840  - interpolated_dxbar_ds(1,0)*interpolated_duds(2,1)
841  - base_flow_duds(1,1)*interpolated_dxhat_ds(2,0));
842  const double interpolated_dWdRS =
843  invJbar*(interpolated_dxbar_ds(1,1)*interpolated_duds(3,0)
844  + base_flow_duds(1,0)*interpolated_dxhat_ds(3,1)
845  - interpolated_dxbar_ds(1,0)*interpolated_duds(3,1)
846  - base_flow_duds(1,1)*interpolated_dxhat_ds(3,0));
847  const double interpolated_dVdRC =
848  invJbar*(interpolated_dxbar_ds(1,1)*interpolated_duds(4,0)
849  + base_flow_duds(2,0)*interpolated_dxhat_ds(2,1)
850  - interpolated_dxbar_ds(1,0)*interpolated_duds(4,1)
851  - base_flow_duds(2,1)*interpolated_dxhat_ds(2,0));
852  const double interpolated_dVdRS =
853  invJbar*(interpolated_dxbar_ds(1,1)*interpolated_duds(5,0)
854  + base_flow_duds(2,0)*interpolated_dxhat_ds(3,1)
855  - interpolated_dxbar_ds(1,0)*interpolated_duds(5,1)
856  - base_flow_duds(2,1)*interpolated_dxhat_ds(3,0));
857  const double interpolated_dUdZC =
858  invJbar*(interpolated_dxbar_ds(0,0)*interpolated_duds(0,1)
859  + base_flow_duds(0,1)*interpolated_dxhat_ds(0,0)
860  - interpolated_dxbar_ds(0,1)*interpolated_duds(0,0)
861  - base_flow_duds(0,0)*interpolated_dxhat_ds(0,1));
862  const double interpolated_dUdZS =
863  invJbar*(interpolated_dxbar_ds(0,0)*interpolated_duds(1,1)
864  + base_flow_duds(0,1)*interpolated_dxhat_ds(1,0)
865  - interpolated_dxbar_ds(0,1)*interpolated_duds(1,0)
866  - base_flow_duds(0,0)*interpolated_dxhat_ds(1,1));
867  const double interpolated_dWdZC =
868  invJbar*(interpolated_dxbar_ds(0,0)*interpolated_duds(2,1)
869  + base_flow_duds(1,1)*interpolated_dxhat_ds(0,0)
870  - interpolated_dxbar_ds(0,1)*interpolated_duds(2,0)
871  - base_flow_duds(1,0)*interpolated_dxhat_ds(0,1));
872  const double interpolated_dWdZS =
873  invJbar*(interpolated_dxbar_ds(0,0)*interpolated_duds(3,1)
874  + base_flow_duds(1,1)*interpolated_dxhat_ds(1,0)
875  - interpolated_dxbar_ds(0,1)*interpolated_duds(3,0)
876  - base_flow_duds(1,0)*interpolated_dxhat_ds(1,1));
877  const double interpolated_dVdZC =
878  invJbar*(interpolated_dxbar_ds(0,0)*interpolated_duds(4,1)
879  + base_flow_duds(2,1)*interpolated_dxhat_ds(0,0)
880  - interpolated_dxbar_ds(0,1)*interpolated_duds(4,0)
881  - base_flow_duds(2,0)*interpolated_dxhat_ds(0,1));
882  const double interpolated_dVdZS =
883  invJbar*(interpolated_dxbar_ds(0,0)*interpolated_duds(5,1)
884  + base_flow_duds(2,1)*interpolated_dxhat_ds(1,0)
885  - interpolated_dxbar_ds(0,1)*interpolated_duds(5,0)
886  - base_flow_duds(2,0)*interpolated_dxhat_ds(1,1));
887 
888  // Define the following useful quantities...
889  Vector<double> group_A(n_node,0.0);
890  Vector<double> group_B(n_node,0.0);
891  Vector<double> group_C(n_node,0.0);
892  Vector<double> group_D(n_node,0.0);
893  Vector<double> group_E(n_node,0.0);
894  DenseMatrix<double> group_F(n_node,n_node,0.0);
895 
896  // Loop over the element's nodes
897  for(unsigned l=0;l<n_node;l++)
898  {
899  group_A[l] = interpolated_dxbar_ds(0,0)*dpsifds(l,1)
900  - interpolated_dxbar_ds(0,1)*dpsifds(l,0);
901  group_B[l] = interpolated_dxbar_ds(1,1)*dpsifds(l,0)
902  - interpolated_dxbar_ds(1,0)*dpsifds(l,1);
903  group_C[l] = base_flow_duds(0,0)*dpsifds(l,1)
904  - base_flow_duds(0,1)*dpsifds(l,0);
905  group_D[l] = base_flow_duds(1,0)*dpsifds(l,1)
906  - base_flow_duds(1,1)*dpsifds(l,0);
907  group_E[l] = base_flow_duds(2,0)*dpsifds(l,1)
908  - base_flow_duds(2,1)*dpsifds(l,0);
909 
910  // Loop over the element's nodes again
911  for(unsigned l2=0;l2<n_node;l2++)
912  {
913  group_F(l,l2) = dtestfds(l,0)*dpsifds(l2,1)
914  - dtestfds(l,1)*dpsifds(l2,0);
915  }
916  }
917 
918  // Allocate storage for the "effective" perturbed spine node fraction
919  Vector<double> effective_perturbed_spine_node_fraction(n_node,0.0);
920 
921  // Loop over the element's nodes
922  for(unsigned l=0;l<n_node;l++)
923  {
924  // Upcast to a PerturbedSpineNode
925  PerturbedSpineNode* nod_pt =
926  dynamic_cast<PerturbedSpineNode*>(this->node_pt(l));
927 
928  // Cache node update fct id
929  const unsigned cached_node_update_fct_id = nod_pt->node_update_fct_id();
930 
931  // Set effective perturbed spine node fraction -- this is different
932  // depending on whether node l uses the lower (0) or upper (1) node
933  // update function
934  if(cached_node_update_fct_id==0)
935  {
936  effective_perturbed_spine_node_fraction[l] = nod_pt->fraction();
937  }
938  else if(cached_node_update_fct_id==1)
939  {
940  effective_perturbed_spine_node_fraction[l] = 1.0 - nod_pt->fraction();
941  }
942  else
943  {
944  throw OomphLibError("Incorrect node_update_fct_id",
945  "LinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_lin_axi_nst()",
947  }
948  }
949 
950  // Cache base flow velocities and their derivatives
951  const double base_flow_ur = base_flow_u[0];
952  const double base_flow_uz = base_flow_u[1];
953  const double base_flow_utheta = base_flow_u[2];
954  const double base_flow_durdr = base_flow_dudx(0,0);
955  const double base_flow_durdz = base_flow_dudx(0,1);
956  const double base_flow_duzdr = base_flow_dudx(1,0);
957  const double base_flow_duzdz = base_flow_dudx(1,1);
958  const double base_flow_duthetadr = base_flow_dudx(2,0);
959  const double base_flow_duthetadz = base_flow_dudx(2,1);
960  const double base_flow_durdt = base_flow_dudt[0];
961  const double base_flow_duzdt = base_flow_dudt[1];
962  const double base_flow_duthetadt = base_flow_dudt[2];
963 
964  // Cache r-component of position
965  const double r = interpolated_x[0];
966 
967  // Cache perturbations to nodal positions
968  const double interpolated_RC = interpolated_xhat[0];
969  const double interpolated_RS = interpolated_xhat[1];
970  const double interpolated_ZC = interpolated_xhat[2];
971  const double interpolated_ZS = interpolated_xhat[3];
972 
973  // Cache temporal derivatives of the perturbations to nodal positions
974  const double dRCdt = dxhat_dt[0];
975  const double dRSdt = dxhat_dt[1];
976  const double dZCdt = dxhat_dt[2];
977  const double dZSdt = dxhat_dt[3];
978 
979  // Cache unknowns
980  const double interpolated_UC = interpolated_u[0];
981  const double interpolated_US = interpolated_u[1];
982  const double interpolated_WC = interpolated_u[2];
983  const double interpolated_WS = interpolated_u[3];
984  const double interpolated_VC = interpolated_u[4];
985  const double interpolated_VS = interpolated_u[5];
986  const double interpolated_PC = interpolated_p[0];
987  const double interpolated_PS = interpolated_p[1];
988 
989  // Cache temporal derivatives of the unknowns
990  const double dUCdt = dudt[0];
991  const double dUSdt = dudt[1];
992  const double dWCdt = dudt[2];
993  const double dWSdt = dudt[3];
994  const double dVCdt = dudt[4];
995  const double dVSdt = dudt[5];
996 
997  // ==================
998  // MOMENTUM EQUATIONS
999  // ==================
1000 
1001  // Loop over the fluid test functions
1002  for(unsigned l=0;l<n_node;l++)
1003  {
1004  // Cache test functions and their derivatives
1005  const double testf_ = testf(l);
1006  const double dtestfdr = dtestfdx(l,0);
1007  const double dtestfdz = dtestfdx(l,1);
1008 
1009  // Compute the following useful quantities...
1010  const double dtestfdRC = invJbar*
1011  (dtestfds(l,0)*interpolated_dxhat_ds(2,1)
1012  - dtestfds(l,1)*interpolated_dxhat_ds(2,0));
1013  const double dtestfdRS = invJbar*
1014  (dtestfds(l,0)*interpolated_dxhat_ds(3,1)
1015  - dtestfds(l,1)*interpolated_dxhat_ds(3,0));
1016  const double dtestfdZC = invJbar*
1017  (dtestfds(l,1)*interpolated_dxhat_ds(0,0)
1018  - dtestfds(l,0)*interpolated_dxhat_ds(0,1));
1019  const double dtestfdZS = invJbar*
1020  (dtestfds(l,1)*interpolated_dxhat_ds(1,0)
1021  - dtestfds(l,0)*interpolated_dxhat_ds(1,1));
1022 
1023  // ---------------------------------------------
1024  // FIRST (RADIAL) MOMENTUM EQUATION: COSINE PART
1025  // ---------------------------------------------
1026 
1027  // Get local equation number of first velocity value at this node
1028  local_eqn = nodal_local_eqn(l,u_nodal_index[0]);
1029 
1030  // If it's not a boundary condition
1031  if(local_eqn >= 0)
1032  {
1033  residuals[local_eqn] -= scaled_re_st*r*dUCdt*testf_*Jbar*w;
1034  residuals[local_eqn] -=
1035  scaled_re_st*interpolated_RC*base_flow_durdt*testf_*Jbar*w;
1036  residuals[local_eqn] -=
1037  scaled_re*r*base_flow_ur*interpolated_dUdRC*testf_*Jbar*w;
1038  residuals[local_eqn] +=
1039  scaled_re_st*r*mesh_velocity[0]*interpolated_dUdRC*testf_*Jbar*w;
1040  residuals[local_eqn] -=
1041  scaled_re*r*interpolated_UC*base_flow_durdr*testf_*Jbar*w;
1042  residuals[local_eqn] +=
1043  scaled_re_st*r*dRCdt*base_flow_durdr*testf_*Jbar*w;
1044  residuals[local_eqn] -=
1045  scaled_re*interpolated_RC*base_flow_ur*base_flow_durdr*testf_*Jbar*w;
1046  residuals[local_eqn] +=
1047  scaled_re_st*interpolated_RC*mesh_velocity[0]*base_flow_durdr
1048  *testf_*Jbar*w;
1049  residuals[local_eqn] -=
1050  k*scaled_re*base_flow_utheta*interpolated_US*testf_*Jbar*w;
1051  residuals[local_eqn] +=
1052  k*scaled_re*base_flow_utheta*base_flow_durdr*interpolated_RS
1053  *testf_*Jbar*w;
1054  residuals[local_eqn] +=
1055  k*scaled_re*base_flow_utheta*base_flow_durdz*interpolated_ZS
1056  *testf_*Jbar*w;
1057  residuals[local_eqn] +=
1058  2*scaled_re*base_flow_utheta*interpolated_VC*testf_*Jbar*w;
1059  residuals[local_eqn] -=
1060  scaled_re*r*base_flow_uz*interpolated_dUdZC*testf_*Jbar*w;
1061  residuals[local_eqn] +=
1062  scaled_re_st*r*mesh_velocity[1]*interpolated_dUdZC*testf_*Jbar*w;
1063  residuals[local_eqn] -=
1064  scaled_re*r*interpolated_WC*base_flow_durdz*testf_*Jbar*w;
1065  residuals[local_eqn] +=
1066  scaled_re_st*r*dZCdt*base_flow_durdz*testf_*Jbar*w;
1067  residuals[local_eqn] -=
1068  scaled_re*interpolated_RC*base_flow_uz*base_flow_durdz*testf_*Jbar*w;
1069  residuals[local_eqn] +=
1070  scaled_re_st*interpolated_RC*mesh_velocity[1]*base_flow_durdz*testf_
1071  *Jbar*w;
1072  residuals[local_eqn] += interpolated_RC*body_force[0]*testf_*Jbar*w;
1073  residuals[local_eqn] +=
1074  scaled_re_inv_fr*interpolated_RC*G[0]*testf_*Jbar*w;
1075  residuals[local_eqn] += r*base_flow_p*dtestfdRC*Jbar*w;
1076  residuals[local_eqn] += r*interpolated_PC*dtestfdr*Jbar*w;
1077  residuals[local_eqn] += interpolated_RC*base_flow_p*dtestfdr*Jbar*w;
1078  residuals[local_eqn] -=
1079  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*dtestfdRC*Jbar*w;
1080  residuals[local_eqn] -=
1081  visc_ratio*(1.0+Gamma[0])*r*interpolated_dUdRC*dtestfdr*Jbar*w;
1082  residuals[local_eqn] +=
1083  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*JhatC*dtestfdr*w;
1084  residuals[local_eqn] -=
1085  visc_ratio*(1.0+Gamma[0])*interpolated_RC*base_flow_durdr*dtestfdr
1086  *Jbar*w;
1087  residuals[local_eqn] +=
1088  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdr*interpolated_RS
1089  *Jbar*w;
1090  residuals[local_eqn] +=
1091  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdz*interpolated_ZS
1092  *Jbar*w;
1093  residuals[local_eqn] +=
1094  k*visc_ratio*Gamma[0]*interpolated_dVdRS*testf_*Jbar*w;
1095  residuals[local_eqn] -=
1096  visc_ratio*k*k*interpolated_UC*testf_*Jbar*w/r;
1097  residuals[local_eqn] +=
1098  visc_ratio*k*k*base_flow_durdr*interpolated_RC*testf_*Jbar*w/r;
1099  residuals[local_eqn] +=
1100  visc_ratio*k*k*base_flow_durdz*interpolated_ZC*testf_*Jbar*w/r;
1101  residuals[local_eqn] -=
1102  visc_ratio*k*base_flow_utheta*dtestfdr*interpolated_RS*Jbar*w/r;
1103  residuals[local_eqn] -=
1104  visc_ratio*k*base_flow_utheta*dtestfdz*interpolated_ZS*Jbar*w/r;
1105  residuals[local_eqn] -= visc_ratio*k*interpolated_VS*testf_*Jbar*w/r;
1106  residuals[local_eqn] +=
1107  visc_ratio*k*interpolated_RS*base_flow_utheta*testf_*Jbar*w/(r*r);
1108  residuals[local_eqn] -=
1109  visc_ratio*Gamma[0]*r*base_flow_duzdr*dtestfdZC*Jbar*w;
1110  residuals[local_eqn] -=
1111  visc_ratio*Gamma[0]*r*interpolated_dWdRC*dtestfdz*Jbar*w;
1112  residuals[local_eqn] +=
1113  visc_ratio*Gamma[0]*r*base_flow_duzdr*JhatC*dtestfdz*w;
1114  residuals[local_eqn] -=
1115  visc_ratio*Gamma[0]*interpolated_RC*base_flow_duzdr*dtestfdz*Jbar*w;
1116  residuals[local_eqn] -= visc_ratio*r*base_flow_durdz*dtestfdZC*Jbar*w;
1117  residuals[local_eqn] -=
1118  visc_ratio*r*interpolated_dUdZC*dtestfdz*Jbar*w;
1119  residuals[local_eqn] += visc_ratio*r*base_flow_durdz*JhatC*dtestfdz*w;
1120  residuals[local_eqn] -=
1121  visc_ratio*interpolated_RC*base_flow_durdz*dtestfdz*Jbar*w;
1122  residuals[local_eqn] += interpolated_PC*testf_*Jbar*w;
1123  residuals[local_eqn] -=
1124  visc_ratio*(1.0+Gamma[0])*k*interpolated_VS*testf_*Jbar*w/r;
1125  residuals[local_eqn] +=
1126  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadr*interpolated_RS
1127  *testf_*Jbar*w/r;
1128  residuals[local_eqn] +=
1129  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadz*interpolated_ZS
1130  *testf_*Jbar*w/r;
1131  residuals[local_eqn] -=
1132  visc_ratio*(1.0+Gamma[0])*interpolated_UC*testf_*Jbar*w/r;
1133  residuals[local_eqn] +=
1134  visc_ratio*(1.0+Gamma[0])*base_flow_ur*interpolated_RC
1135  *testf_*Jbar*w/(r*r);
1136  residuals[local_eqn] -= scaled_re_st*r*base_flow_durdt*testf_*JhatC*w;
1137  residuals[local_eqn] +=
1138  scaled_re*base_flow_utheta*base_flow_utheta*testf_*JhatC*w;
1139  residuals[local_eqn] += r*body_force[0]*testf_*JhatC*w;
1140  residuals[local_eqn] += scaled_re_inv_fr*r*G[0]*testf_*JhatC*w;
1141  residuals[local_eqn] -= k*visc_ratio*base_flow_utheta*testf_*JhatS*w/r;
1142  residuals[local_eqn] += base_flow_p*testf_*JhatC*w;
1143  residuals[local_eqn] -=
1144  visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*JhatC*w/r;
1145 
1146  // Calculate the Jacobian
1147  // ----------------------
1148 
1149  if(flag)
1150  {
1151  // Loop over the velocity shape functions again
1152  for(unsigned l2=0;l2<n_node;l2++)
1153  {
1154  // Radial velocity component (cosine part) U_k^C
1155  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
1156  if(local_unknown >= 0)
1157  {
1158  if(flag==2)
1159  {
1160  // Add the mass matrix
1161  mass_matrix(local_eqn,local_unknown) +=
1162  scaled_re_st*r*psif[l2]*testf_*Jbar*w;
1163  }
1164 
1165  // Add contributions to the Jacobian matrix
1166  jacobian(local_eqn,local_unknown) -=
1167  scaled_re_st*r*psif[l2]
1168  *node_pt(l2)->time_stepper_pt()->weight(1,0)*testf_*Jbar*w;
1169  jacobian(local_eqn,local_unknown) -=
1170  scaled_re*r*base_flow_ur*group_B[l2]*testf_*w;
1171  jacobian(local_eqn,local_unknown) +=
1172  scaled_re_st*r*mesh_velocity[0]*group_B[l2]*testf_*w;
1173  jacobian(local_eqn,local_unknown) -=
1174  scaled_re*r*psif[l2]*base_flow_durdr*testf_*Jbar*w;
1175  jacobian(local_eqn,local_unknown) -=
1176  scaled_re*r*base_flow_uz*group_A[l2]*testf_*w;
1177  jacobian(local_eqn,local_unknown) +=
1178  scaled_re_st*r*mesh_velocity[1]*group_A[l2]*testf_*w;
1179  jacobian(local_eqn,local_unknown) -=
1180  visc_ratio*(1.0+Gamma[0])*r*group_B[l2]*dtestfdr*w;
1181  jacobian(local_eqn,local_unknown) -=
1182  visc_ratio*k*k*psif[l2]*testf_*Jbar*w/r;
1183  jacobian(local_eqn,local_unknown) -=
1184  visc_ratio*r*group_A[l2]*dtestfdz*w;
1185  jacobian(local_eqn,local_unknown) -=
1186  visc_ratio*(1.0+Gamma[0])*psif[l2]*testf_*Jbar*w/r;
1187  }
1188 
1189  // Radial velocity component (sine part) U_k^S
1190  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
1191  if(local_unknown >= 0)
1192  {
1193  jacobian(local_eqn,local_unknown) -=
1194  k*scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
1195  }
1196 
1197  // Axial velocity component (cosine part) W_k^C
1198  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
1199  if(local_unknown >= 0)
1200  {
1201  jacobian(local_eqn,local_unknown) -=
1202  scaled_re*r*psif[l2]*base_flow_durdz*testf_*Jbar*w;
1203  jacobian(local_eqn,local_unknown) -=
1204  visc_ratio*Gamma[0]*r*group_B[l2]*dtestfdz*w;
1205  }
1206 
1207  // Axial velocity component (sine part) W_k^S
1208  // has no contribution
1209 
1210  // Azimuthal velocity component (cosine part) V_k^C
1211  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
1212  if(local_unknown >= 0)
1213  {
1214  jacobian(local_eqn,local_unknown) +=
1215  2.0*scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
1216  }
1217 
1218  // Azimuthal velocity component (sine part) V_k^S
1219  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
1220  if(local_unknown >= 0)
1221  {
1222  jacobian(local_eqn,local_unknown) +=
1223  k*visc_ratio*Gamma[0]*group_B[l2]*testf_*w;
1224  jacobian(local_eqn,local_unknown) -=
1225  visc_ratio*k*psif[l2]*testf_*Jbar*w/r;
1226  jacobian(local_eqn,local_unknown) -=
1227  visc_ratio*(1.0+Gamma[0])*k*psif[l2]*testf_*Jbar*w/r;
1228  }
1229 
1230  // Perturbation to radial nodal coord (cosine part) R_k^C
1231  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[0]);
1232  if(local_unknown >= 0)
1233  {
1234  jacobian(local_eqn,local_unknown) -=
1235  scaled_re_st*psif[l2]*base_flow_durdt*testf_*Jbar*w;
1236  jacobian(local_eqn,local_unknown) +=
1237  scaled_re_st*r*psif[l2]
1239  *base_flow_durdr*testf_*Jbar*w;
1240  jacobian(local_eqn,local_unknown) -=
1241  scaled_re*psif[l2]*base_flow_ur*base_flow_durdr*testf_*Jbar*w;
1242  jacobian(local_eqn,local_unknown) +=
1243  scaled_re_st*psif[l2]*mesh_velocity[0]*base_flow_durdr
1244  *testf_*Jbar*w;
1245  jacobian(local_eqn,local_unknown) +=
1246  scaled_re*r*base_flow_uz*group_C[l2]*testf_*w;
1247  jacobian(local_eqn,local_unknown) -=
1248  scaled_re_st*r*mesh_velocity[1]*group_C[l2]*testf_*w;
1249  jacobian(local_eqn,local_unknown) -=
1250  scaled_re*psif[l2]*base_flow_uz*base_flow_durdz*testf_*Jbar*w;
1251  jacobian(local_eqn,local_unknown) +=
1252  scaled_re_st*psif[l2]*mesh_velocity[1]*base_flow_durdz
1253  *testf_*Jbar*w;
1254  jacobian(local_eqn,local_unknown) +=
1255  psif[l2]*body_force[0]*testf_*Jbar*w;
1256  jacobian(local_eqn,local_unknown) +=
1257  scaled_re_inv_fr*psif[l2]*G[0]*testf_*Jbar*w;
1258  jacobian(local_eqn,local_unknown) +=
1259  psif[l2]*base_flow_p*dtestfdr*Jbar*w;
1260  jacobian(local_eqn,local_unknown) +=
1261  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*group_B[l2]
1262  *dtestfdr*w;
1263  jacobian(local_eqn,local_unknown) -=
1264  visc_ratio*(1.0+Gamma[0])*psif[l2]*base_flow_durdr
1265  *dtestfdr*Jbar*w;
1266  jacobian(local_eqn,local_unknown) +=
1267  visc_ratio*k*k*base_flow_durdr*psif[l2]*testf_*Jbar*w/r;
1268  jacobian(local_eqn,local_unknown) +=
1269  visc_ratio*Gamma[0]*r*base_flow_duzdr*group_F(l,l2)*w;
1270  jacobian(local_eqn,local_unknown) +=
1271  visc_ratio*Gamma[0]*r*base_flow_duzdr*group_B[l2]*dtestfdz*w;
1272  jacobian(local_eqn,local_unknown) -=
1273  visc_ratio*Gamma[0]*psif[l2]*base_flow_duzdr*dtestfdz*Jbar*w;
1274  jacobian(local_eqn,local_unknown) +=
1275  visc_ratio*r*base_flow_durdz*group_F(l,l2)*w;
1276  jacobian(local_eqn,local_unknown) +=
1277  visc_ratio*r*group_C[l2]*dtestfdz*w;
1278  jacobian(local_eqn,local_unknown) +=
1279  visc_ratio*r*base_flow_durdz*group_B[l2]*dtestfdz*w;
1280  jacobian(local_eqn,local_unknown) -=
1281  visc_ratio*psif[l2]*base_flow_durdz*dtestfdz*Jbar*w;
1282  jacobian(local_eqn,local_unknown) +=
1283  visc_ratio*(1.0+Gamma[0])*base_flow_ur*psif[l2]*testf_
1284  *Jbar*w/(r*r);
1285  jacobian(local_eqn,local_unknown) -=
1286  scaled_re_st*r*base_flow_durdt*testf_*group_B[l2]*w;
1287  jacobian(local_eqn,local_unknown) +=
1288  scaled_re*base_flow_utheta*base_flow_utheta*testf_*group_B[l2]*w;
1289  jacobian(local_eqn,local_unknown) +=
1290  r*body_force[0]*testf_*group_B[l2]*w;
1291  jacobian(local_eqn,local_unknown) +=
1292  scaled_re_inv_fr*r*G[0]*testf_*group_B[l2]*w;
1293  jacobian(local_eqn,local_unknown) +=
1294  base_flow_p*testf_*group_B[l2]*w;
1295  jacobian(local_eqn,local_unknown) -=
1296  visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*group_B[l2]*w/r;
1297  }
1298 
1299  // Perturbation to radial nodal coord (sine part) R_k^S
1300  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[1]);
1301  if(local_unknown >= 0)
1302  {
1303  jacobian(local_eqn,local_unknown) +=
1304  k*scaled_re*base_flow_utheta*base_flow_durdr*psif[l2]
1305  *testf_*Jbar*w;
1306  jacobian(local_eqn,local_unknown) +=
1307  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdr*psif[l2]
1308  *Jbar*w;
1309  jacobian(local_eqn,local_unknown) -=
1310  visc_ratio*k*base_flow_utheta*dtestfdr*psif[l2]*Jbar*w/r;
1311  jacobian(local_eqn,local_unknown) +=
1312  visc_ratio*k*psif[l2]*base_flow_utheta*testf_*Jbar*w/(r*r);
1313  jacobian(local_eqn,local_unknown) +=
1314  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadr*psif[l2]
1315  *testf_*Jbar*w/r;
1316  jacobian(local_eqn,local_unknown) -=
1317  k*visc_ratio*base_flow_utheta*testf_*group_B[l2]*w/r;
1318  }
1319 
1320  // Perturbation to axial nodal coord (cosine part) Z_k^C
1321  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[2]);
1322  if(local_unknown >= 0)
1323  {
1324  jacobian(local_eqn,local_unknown) -=
1325  scaled_re*r*base_flow_ur*group_C[l2]*testf_*w;
1326  jacobian(local_eqn,local_unknown) +=
1327  scaled_re_st*r*mesh_velocity[0]*group_C[l2]*testf_*w;
1328  jacobian(local_eqn,local_unknown) +=
1329  scaled_re_st*r*psif[l2]
1331  *base_flow_durdz*testf_*Jbar*w;
1332  jacobian(local_eqn,local_unknown) +=
1333  r*base_flow_p*group_F(l,l2)*w;
1334  jacobian(local_eqn,local_unknown) -=
1335  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*group_F(l,l2)*w;
1336  jacobian(local_eqn,local_unknown) -=
1337  visc_ratio*(1.0+Gamma[0])*r*group_C[l2]*dtestfdr*w;
1338  jacobian(local_eqn,local_unknown) +=
1339  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*group_A[l2]
1340  *dtestfdr*w;
1341  jacobian(local_eqn,local_unknown) +=
1342  visc_ratio*k*k*base_flow_durdz*psif[l2]*testf_*Jbar*w/r;
1343  jacobian(local_eqn,local_unknown) -=
1344  visc_ratio*Gamma[0]*r*group_D[l2]*dtestfdz*w;
1345  jacobian(local_eqn,local_unknown) +=
1346  visc_ratio*Gamma[0]*r*base_flow_duzdr*group_A[l2]*dtestfdz*w;
1347  jacobian(local_eqn,local_unknown) +=
1348  visc_ratio*r*base_flow_durdz*group_A[l2]*dtestfdz*w;
1349  jacobian(local_eqn,local_unknown) -=
1350  scaled_re_st*r*base_flow_durdt*testf_*group_A[l2]*w;
1351  jacobian(local_eqn,local_unknown) +=
1352  scaled_re*base_flow_utheta*base_flow_utheta*testf_
1353  *group_A[l2]*w;
1354  jacobian(local_eqn,local_unknown) +=
1355  r*body_force[0]*testf_*group_A[l2]*w;
1356  jacobian(local_eqn,local_unknown) +=
1357  scaled_re_inv_fr*r*G[0]*testf_*group_A[l2]*w;
1358  jacobian(local_eqn,local_unknown) +=
1359  base_flow_p*testf_*group_A[l2]*w;
1360  jacobian(local_eqn,local_unknown) -=
1361  visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*group_A[l2]*w/r;
1362  }
1363 
1364  // Perturbation to axial nodal coord (sine part) Z_k^S
1365  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[3]);
1366  if(local_unknown >= 0)
1367  {
1368  jacobian(local_eqn,local_unknown) +=
1369  k*scaled_re*base_flow_utheta*base_flow_durdz*psif[l2]
1370  *testf_*Jbar*w;
1371  jacobian(local_eqn,local_unknown) +=
1372  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdz*psif[l2]
1373  *Jbar*w;
1374  jacobian(local_eqn,local_unknown) +=
1375  k*visc_ratio*Gamma[0]*group_E[l2]*testf_*w;
1376  jacobian(local_eqn,local_unknown) -=
1377  visc_ratio*k*base_flow_utheta*dtestfdz*psif[l2]*Jbar*w/r;
1378  jacobian(local_eqn,local_unknown) +=
1379  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadz*psif[l2]
1380  *testf_*Jbar*w/r;
1381  jacobian(local_eqn,local_unknown) -=
1382  k*visc_ratio*base_flow_utheta*testf_*group_A[l2]*w/r;
1383  }
1384 
1385  } // End of loop over velocity shape functions
1386 
1387  // Now loop over pressure shape functions
1388  // (This is the contribution from pressure gradient)
1389  for(unsigned l2=0;l2<n_pres;l2++)
1390  {
1391  // Cosine part P_k^C
1392  local_unknown = p_local_eqn(l2,0);
1393  if(local_unknown >= 0)
1394  {
1395  jacobian(local_eqn,local_unknown) += r*psip[l2]*dtestfdr*Jbar*w;
1396  jacobian(local_eqn,local_unknown) += psip[l2]*testf_*Jbar*w;
1397  }
1398 
1399  // Sine part P_k^S has no contribution
1400 
1401  } // End of loop over pressure shape functions
1402 
1403  // Now loop over the spines in the element
1404  for(unsigned l2=0;l2<n_p;l2++)
1405  {
1406  // Perturbed spine "height" (cosine part) H_k^C
1407  local_unknown =
1409 
1410  if(local_unknown >= 0)
1411  {
1412  for(unsigned a=0;a<3;a++)
1413  {
1414  double sum = 0.0;
1415 
1416  sum -= scaled_re*r*base_flow_ur*group_C[l2+(3*a)]*testf_*w;
1417  sum += scaled_re_st*r*mesh_velocity[0]*group_C[l2+(3*a)]
1418  *testf_*w;
1419  sum += scaled_re_st*r*psif[l2+(3*a)]
1420  *node_pt(l2+(3*a))->position_time_stepper_pt()->weight(1,0)
1421  *base_flow_durdz*testf_*Jbar*w;
1422  sum += r*base_flow_p*group_F(l,(l2+(3*a)))*w;
1423  sum -= visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr
1424  *group_F(l,(l2+(3*a)))*w;
1425  sum -= visc_ratio*(1.0+Gamma[0])*r*group_C[l2+(3*a)]
1426  *dtestfdr*w;
1427  sum += visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr
1428  *group_A[l2+(3*a)]*dtestfdr*w;
1429  sum += visc_ratio*k*k*base_flow_durdz*psif[l2+(3*a)]
1430  *testf_*Jbar*w/r;
1431  sum -= visc_ratio*Gamma[0]*r*group_D[l2+(3*a)]*dtestfdz*w;
1432  sum += visc_ratio*Gamma[0]*r*base_flow_duzdr
1433  *group_A[l2+(3*a)]*dtestfdz*w;
1434  sum += visc_ratio*r*base_flow_durdz*group_A[l2+(3*a)]
1435  *dtestfdz*w;
1436  sum -= scaled_re_st*r*base_flow_durdt*testf_
1437  *group_A[l2+(3*a)]*w;
1438  sum += scaled_re*base_flow_utheta*base_flow_utheta
1439  *testf_*group_A[l2+(3*a)]*w;
1440  sum += r*body_force[0]*testf_*group_A[l2+(3*a)]*w;
1441  sum += scaled_re_inv_fr*r*G[0]*testf_*group_A[l2+(3*a)]*w;
1442  sum += base_flow_p*testf_*group_A[l2+(3*a)]*w;
1443  sum -= visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_
1444  *group_A[l2+(3*a)]*w/r;
1445 
1446  jacobian(local_eqn,local_unknown) +=
1447  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
1448  }
1449  }
1450 
1451  // Perturbed spine "height" (sine part) H_k^S
1452  local_unknown =
1454 
1455  if(local_unknown >= 0)
1456  {
1457  for(unsigned a=0;a<3;a++)
1458  {
1459  double sum = 0.0;
1460 
1461  sum += k*scaled_re*base_flow_utheta*base_flow_durdz
1462  *psif[l2+(3*a)]*testf_*Jbar*w;
1463  sum += k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdz
1464  *psif[l2+(3*a)]*Jbar*w;
1465  sum += k*visc_ratio*Gamma[0]*group_E[l2+(3*a)]*testf_*w;
1466  sum -= visc_ratio*k*base_flow_utheta*dtestfdz
1467  *psif[l2+(3*a)]*Jbar*w/r;
1468  sum += visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadz
1469  *psif[l2+(3*a)]*testf_*Jbar*w/r;
1470  sum -= k*visc_ratio*base_flow_utheta*testf_
1471  *group_A[l2+(3*a)]*w/r;
1472 
1473  jacobian(local_eqn,local_unknown) +=
1474  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
1475  }
1476  }
1477  } // End of loop over spines in the element
1478  } // End of Jacobian calculation
1479 
1480  } // End of if not boundary condition statement
1481 
1482  // --------------------------------------------
1483  // SECOND (RADIAL) MOMENTUM EQUATION: SINE PART
1484  // --------------------------------------------
1485 
1486  // Get local equation number of second velocity value at this node
1487  local_eqn = nodal_local_eqn(l,u_nodal_index[1]);
1488 
1489  // If it's not a boundary condition
1490  if(local_eqn >= 0)
1491  {
1492  residuals[local_eqn] -= scaled_re_st*r*dUSdt*testf_*Jbar*w;
1493  residuals[local_eqn] -=
1494  scaled_re_st*interpolated_RS*base_flow_durdt*testf_*Jbar*w;
1495  residuals[local_eqn] -=
1496  scaled_re*r*base_flow_ur*interpolated_dUdRS*testf_*Jbar*w;
1497  residuals[local_eqn] +=
1498  scaled_re_st*r*mesh_velocity[0]*interpolated_dUdRS*testf_*Jbar*w;
1499  residuals[local_eqn] -=
1500  scaled_re*r*interpolated_US*base_flow_durdr*testf_*Jbar*w;
1501  residuals[local_eqn] +=
1502  scaled_re_st*r*dRSdt*base_flow_durdr*testf_*Jbar*w;
1503  residuals[local_eqn] -=
1504  scaled_re*interpolated_RS*base_flow_ur*base_flow_durdr
1505  *testf_*Jbar*w;
1506  residuals[local_eqn] +=
1507  scaled_re_st*interpolated_RS*mesh_velocity[0]*base_flow_durdr
1508  *testf_*Jbar*w;
1509  residuals[local_eqn] +=
1510  k*scaled_re*base_flow_utheta*interpolated_UC*testf_*Jbar*w;
1511  residuals[local_eqn] -=
1512  k*scaled_re*base_flow_utheta*base_flow_durdr*interpolated_RC
1513  *testf_*Jbar*w;
1514  residuals[local_eqn] -=
1515  k*scaled_re*base_flow_utheta*base_flow_durdz*interpolated_ZC
1516  *testf_*Jbar*w;
1517  residuals[local_eqn] +=
1518  2*scaled_re*base_flow_utheta*interpolated_VS*testf_*Jbar*w;
1519  residuals[local_eqn] -=
1520  scaled_re*r*base_flow_uz*interpolated_dUdZS*testf_*Jbar*w;
1521  residuals[local_eqn] +=
1522  scaled_re_st*r*mesh_velocity[1]*interpolated_dUdZS*testf_*Jbar*w;
1523  residuals[local_eqn] -=
1524  scaled_re*r*interpolated_WS*base_flow_durdz*testf_*Jbar*w;
1525  residuals[local_eqn] +=
1526  scaled_re_st*r*dZSdt*base_flow_durdz*testf_*Jbar*w;
1527  residuals[local_eqn] -=
1528  scaled_re*interpolated_RS*base_flow_uz*base_flow_durdz*testf_*Jbar*w;
1529  residuals[local_eqn] +=
1530  scaled_re_st*interpolated_RS*mesh_velocity[1]*base_flow_durdz
1531  *testf_*Jbar*w;
1532  residuals[local_eqn] += interpolated_RS*body_force[0]*testf_*Jbar*w;
1533  residuals[local_eqn] +=
1534  scaled_re_inv_fr*interpolated_RS*G[0]*testf_*Jbar*w;
1535  residuals[local_eqn] += r*base_flow_p*dtestfdRS*Jbar*w;
1536  residuals[local_eqn] += r*interpolated_PS*dtestfdr*Jbar*w;
1537  residuals[local_eqn] += interpolated_RS*base_flow_p*dtestfdr*Jbar*w;
1538  residuals[local_eqn] -=
1539  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*dtestfdRS*Jbar*w;
1540  residuals[local_eqn] -=
1541  visc_ratio*(1.0+Gamma[0])*r*interpolated_dUdRS*dtestfdr*Jbar*w;
1542  residuals[local_eqn] +=
1543  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*JhatS*dtestfdr*w;
1544  residuals[local_eqn] -=
1545  visc_ratio*(1.0+Gamma[0])*interpolated_RS*base_flow_durdr*dtestfdr
1546  *Jbar*w;
1547  residuals[local_eqn] -=
1548  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdr*interpolated_RC
1549  *Jbar*w;
1550  residuals[local_eqn] -=
1551  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdz*interpolated_ZC
1552  *Jbar*w;
1553  residuals[local_eqn] -=
1554  k*visc_ratio*Gamma[0]*interpolated_dVdRC*testf_*Jbar*w;
1555  residuals[local_eqn] -= visc_ratio*k*k*interpolated_US*testf_*Jbar*w/r;
1556  residuals[local_eqn] +=
1557  visc_ratio*k*k*base_flow_durdr*interpolated_RS*testf_*Jbar*w/r;
1558  residuals[local_eqn] +=
1559  visc_ratio*k*k*base_flow_durdz*interpolated_ZS*testf_*Jbar*w/r;
1560  residuals[local_eqn] +=
1561  visc_ratio*k*base_flow_utheta*dtestfdr*interpolated_RC*Jbar*w/r;
1562  residuals[local_eqn] +=
1563  visc_ratio*k*base_flow_utheta*dtestfdz*interpolated_ZC*Jbar*w/r;
1564  residuals[local_eqn] += visc_ratio*k*interpolated_VC*testf_*Jbar*w/r;
1565  residuals[local_eqn] -=
1566  visc_ratio*k*interpolated_RC*base_flow_utheta*testf_*Jbar*w/(r*r);
1567  residuals[local_eqn] -=
1568  visc_ratio*Gamma[0]*r*base_flow_duzdr*dtestfdZS*Jbar*w;
1569  residuals[local_eqn] -=
1570  visc_ratio*Gamma[0]*r*interpolated_dWdRS*dtestfdz*Jbar*w;
1571  residuals[local_eqn] +=
1572  visc_ratio*Gamma[0]*r*base_flow_duzdr*JhatS*dtestfdz*w;
1573  residuals[local_eqn] -=
1574  visc_ratio*Gamma[0]*interpolated_RS*base_flow_duzdr*dtestfdz*Jbar*w;
1575  residuals[local_eqn] -= visc_ratio*r*base_flow_durdz*dtestfdZS*Jbar*w;
1576  residuals[local_eqn] -=
1577  visc_ratio*r*interpolated_dUdZS*dtestfdz*Jbar*w;
1578  residuals[local_eqn] += visc_ratio*r*base_flow_durdz*JhatS*dtestfdz*w;
1579  residuals[local_eqn] -=
1580  visc_ratio*interpolated_RS*base_flow_durdz*dtestfdz*Jbar*w;
1581  residuals[local_eqn] += interpolated_PS*testf_*Jbar*w;
1582  residuals[local_eqn] +=
1583  visc_ratio*(1.0+Gamma[0])*k*interpolated_VC*testf_*Jbar*w/r;
1584  residuals[local_eqn] -=
1585  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadr*interpolated_RC
1586  *testf_*Jbar*w/r;
1587  residuals[local_eqn] -=
1588  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadz*interpolated_ZC
1589  *testf_*Jbar*w/r;
1590  residuals[local_eqn] -=
1591  visc_ratio*(1.0+Gamma[0])*interpolated_US*testf_*Jbar*w/r;
1592  residuals[local_eqn] +=
1593  visc_ratio*(1.0+Gamma[0])*base_flow_ur*interpolated_RS*testf_
1594  *Jbar*w/(r*r);
1595  residuals[local_eqn] -= scaled_re_st*r*base_flow_durdt*testf_*JhatS*w;
1596  residuals[local_eqn] +=
1597  scaled_re*base_flow_utheta*base_flow_utheta*testf_*JhatS*w;
1598  residuals[local_eqn] += r*body_force[0]*testf_*JhatS*w;
1599  residuals[local_eqn] += scaled_re_inv_fr*r*G[0]*testf_*JhatS*w;
1600  residuals[local_eqn] += k*visc_ratio*base_flow_utheta*testf_*JhatC*w/r;
1601  residuals[local_eqn] += base_flow_p*testf_*JhatS*w;
1602  residuals[local_eqn] -=
1603  visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*JhatS*w/r;
1604 
1605 
1606  // Calculate the Jacobian
1607  // ----------------------
1608 
1609  if(flag)
1610  {
1611  // Loop over the velocity shape functions again
1612  for(unsigned l2=0;l2<n_node;l2++)
1613  {
1614  // Radial velocity component (cosine part) U_k^C
1615  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
1616  if(local_unknown >= 0)
1617  {
1618  jacobian(local_eqn,local_unknown) +=
1619  k*scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
1620  }
1621 
1622  // Radial velocity component (sine part) U_k^S
1623  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
1624  if(local_unknown >= 0)
1625  {
1626  if(flag==2)
1627  {
1628  // Add the mass matrix
1629  mass_matrix(local_eqn,local_unknown) +=
1630  scaled_re_st*r*psif[l2]*testf_*Jbar*w;
1631  }
1632 
1633  // Add contributions to the Jacobian matrix
1634  jacobian(local_eqn,local_unknown) -=
1635  scaled_re_st*r*psif[l2]
1636  *node_pt(l2)->time_stepper_pt()->weight(1,0)*testf_*Jbar*w;
1637  jacobian(local_eqn,local_unknown) -=
1638  scaled_re*r*base_flow_ur*group_B[l2]*testf_*w;
1639  jacobian(local_eqn,local_unknown) +=
1640  scaled_re_st*r*mesh_velocity[0]*group_B[l2]*testf_*w;
1641  jacobian(local_eqn,local_unknown) -=
1642  scaled_re*r*psif[l2]*base_flow_durdr*testf_*Jbar*w;
1643  jacobian(local_eqn,local_unknown) -=
1644  scaled_re*r*base_flow_uz*group_A[l2]*testf_*w;
1645  jacobian(local_eqn,local_unknown) +=
1646  scaled_re_st*r*mesh_velocity[1]*group_A[l2]*testf_*w;
1647  jacobian(local_eqn,local_unknown) -=
1648  visc_ratio*(1.0+Gamma[0])*r*group_B[l2]*dtestfdr*w;
1649  jacobian(local_eqn,local_unknown) -=
1650  visc_ratio*k*k*psif[l2]*testf_*Jbar*w/r;
1651  jacobian(local_eqn,local_unknown) -=
1652  visc_ratio*r*group_A[l2]*dtestfdz*w;
1653  jacobian(local_eqn,local_unknown) -=
1654  visc_ratio*(1.0+Gamma[0])*psif[l2]*testf_*Jbar*w/r;
1655  }
1656 
1657  // Axial velocity component (cosine part) W_k^C
1658  // has no contribution
1659 
1660  // Axial velocity component (sine part) W_k^S
1661  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
1662  if(local_unknown >= 0)
1663  {
1664  jacobian(local_eqn,local_unknown) -=
1665  scaled_re*r*psif[l2]*base_flow_durdz*testf_*Jbar*w;
1666  jacobian(local_eqn,local_unknown) -=
1667  visc_ratio*Gamma[0]*r*group_B[l2]*dtestfdz*w;
1668  }
1669 
1670  // Azimuthal velocity component (cosine part) V_k^C
1671  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
1672  if(local_unknown >= 0)
1673  {
1674  jacobian(local_eqn,local_unknown) -=
1675  k*visc_ratio*Gamma[0]*group_B[l2]*testf_*w;
1676  jacobian(local_eqn,local_unknown) +=
1677  visc_ratio*k*psif[l2]*testf_*Jbar*w/r;
1678  jacobian(local_eqn,local_unknown) +=
1679  visc_ratio*(1.0+Gamma[0])*k*psif[l2]*testf_*Jbar*w/r;
1680  }
1681 
1682  // Azimuthal velocity component (sine part) V_k^S
1683  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
1684  if(local_unknown >= 0)
1685  {
1686  jacobian(local_eqn,local_unknown) +=
1687  2.0*scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
1688  }
1689 
1690  // Perturbation to radial nodal coord (cosine part) R_k^C
1691  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[0]);
1692  if(local_unknown >= 0)
1693  {
1694  jacobian(local_eqn,local_unknown) -=
1695  k*scaled_re*base_flow_utheta*base_flow_durdr*psif[l2]
1696  *testf_*Jbar*w;
1697  jacobian(local_eqn,local_unknown) -=
1698  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdr
1699  *psif[l2]*Jbar*w;
1700  jacobian(local_eqn,local_unknown) +=
1701  visc_ratio*k*base_flow_utheta*dtestfdr*psif[l2]*Jbar*w/r;
1702  jacobian(local_eqn,local_unknown) -=
1703  visc_ratio*k*psif[l2]*base_flow_utheta*testf_*Jbar*w/(r*r);
1704  jacobian(local_eqn,local_unknown) -=
1705  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadr*psif[l2]
1706  *testf_*Jbar*w/r;
1707  jacobian(local_eqn,local_unknown) +=
1708  k*visc_ratio*base_flow_utheta*testf_*group_B[l2]*w/r;
1709  }
1710 
1711  // Perturbation to radial nodal coord (sine part) R_k^S
1712  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[1]);
1713  if(local_unknown >= 0)
1714  {
1715  jacobian(local_eqn,local_unknown) -=
1716  scaled_re_st*psif[l2]*base_flow_durdt*testf_*Jbar*w;
1717  jacobian(local_eqn,local_unknown) +=
1718  scaled_re_st*r*psif[l2]
1720  *base_flow_durdr*testf_*Jbar*w;
1721  jacobian(local_eqn,local_unknown) -=
1722  scaled_re*psif[l2]*base_flow_ur*base_flow_durdr*testf_*Jbar*w;
1723  jacobian(local_eqn,local_unknown) +=
1724  scaled_re_st*psif[l2]*mesh_velocity[0]*base_flow_durdr
1725  *testf_*Jbar*w;
1726  jacobian(local_eqn,local_unknown) +=
1727  scaled_re*r*base_flow_uz*group_C[l2]*testf_*w;
1728  jacobian(local_eqn,local_unknown) -=
1729  scaled_re_st*r*mesh_velocity[1]*group_C[l2]*testf_*w;
1730  jacobian(local_eqn,local_unknown) -=
1731  scaled_re*psif[l2]*base_flow_uz*base_flow_durdz*testf_*Jbar*w;
1732  jacobian(local_eqn,local_unknown) +=
1733  scaled_re_st*psif[l2]*mesh_velocity[1]*base_flow_durdz
1734  *testf_*Jbar*w;
1735  jacobian(local_eqn,local_unknown) +=
1736  psif[l2]*body_force[0]*testf_*Jbar*w;
1737  jacobian(local_eqn,local_unknown) +=
1738  scaled_re_inv_fr*psif[l2]*G[0]*testf_*Jbar*w;
1739  jacobian(local_eqn,local_unknown) +=
1740  psif[l2]*base_flow_p*dtestfdr*Jbar*w;
1741  jacobian(local_eqn,local_unknown) +=
1742  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*group_B[l2]
1743  *dtestfdr*w;
1744  jacobian(local_eqn,local_unknown) -=
1745  visc_ratio*(1.0+Gamma[0])*psif[l2]*base_flow_durdr
1746  *dtestfdr*Jbar*w;
1747  jacobian(local_eqn,local_unknown) +=
1748  visc_ratio*k*k*base_flow_durdr*psif[l2]*testf_*Jbar*w/r;
1749  jacobian(local_eqn,local_unknown) +=
1750  visc_ratio*Gamma[0]*r*base_flow_duzdr*group_F(l,l2)*w;
1751  jacobian(local_eqn,local_unknown) +=
1752  visc_ratio*Gamma[0]*r*base_flow_duzdr*group_B[l2]*dtestfdz*w;
1753  jacobian(local_eqn,local_unknown) -=
1754  visc_ratio*Gamma[0]*psif[l2]*base_flow_duzdr*dtestfdz*Jbar*w;
1755  jacobian(local_eqn,local_unknown) +=
1756  visc_ratio*r*base_flow_durdz*group_F(l,l2)*w;
1757  jacobian(local_eqn,local_unknown) +=
1758  visc_ratio*r*group_C[l2]*dtestfdz*w;
1759  jacobian(local_eqn,local_unknown) +=
1760  visc_ratio*r*base_flow_durdz*group_B[l2]*dtestfdz*w;
1761  jacobian(local_eqn,local_unknown) -=
1762  visc_ratio*psif[l2]*base_flow_durdz*dtestfdz*Jbar*w;
1763  jacobian(local_eqn,local_unknown) +=
1764  visc_ratio*(1.0+Gamma[0])*base_flow_ur*psif[l2]
1765  *testf_*Jbar*w/(r*r);
1766  jacobian(local_eqn,local_unknown) -=
1767  scaled_re_st*r*base_flow_durdt*testf_*group_B[l2]*w;
1768  jacobian(local_eqn,local_unknown) +=
1769  scaled_re*base_flow_utheta*base_flow_utheta
1770  *testf_*group_B[l2]*w;
1771  jacobian(local_eqn,local_unknown) +=
1772  r*body_force[0]*testf_*group_B[l2]*w;
1773  jacobian(local_eqn,local_unknown) +=
1774  scaled_re_inv_fr*r*G[0]*testf_*group_B[l2]*w;
1775  jacobian(local_eqn,local_unknown) +=
1776  base_flow_p*testf_*group_B[l2]*w;
1777  jacobian(local_eqn,local_unknown) -=
1778  visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*group_B[l2]*w/r;
1779  }
1780 
1781  // Perturbation to axial nodal coord (cosine part) Z_k^C
1782  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[2]);
1783  if(local_unknown >= 0)
1784  {
1785  jacobian(local_eqn,local_unknown) -=
1786  k*scaled_re*base_flow_utheta*base_flow_durdz*psif[l2]
1787  *testf_*Jbar*w;
1788  jacobian(local_eqn,local_unknown) -=
1789  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdz
1790  *psif[l2]*Jbar*w;
1791  jacobian(local_eqn,local_unknown) -=
1792  k*visc_ratio*Gamma[0]*group_E[l2]*testf_*w;
1793  jacobian(local_eqn,local_unknown) +=
1794  visc_ratio*k*base_flow_utheta*dtestfdz*psif[l2]*Jbar*w/r;
1795  jacobian(local_eqn,local_unknown) -=
1796  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadz*psif[l2]
1797  *testf_*Jbar*w/r;
1798  jacobian(local_eqn,local_unknown) +=
1799  k*visc_ratio*base_flow_utheta*testf_*group_A[l2]*w/r;
1800  }
1801 
1802  // Perturbation to axial nodal coord (sine part) Z_k^S
1803  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[3]);
1804  if(local_unknown >= 0)
1805  {
1806  jacobian(local_eqn,local_unknown) -=
1807  scaled_re*r*base_flow_ur*group_C[l2]*testf_*w;
1808  jacobian(local_eqn,local_unknown) +=
1809  scaled_re_st*r*mesh_velocity[0]*group_C[l2]*testf_*w;
1810  jacobian(local_eqn,local_unknown) +=
1811  scaled_re_st*r*psif[l2]
1813  *base_flow_durdz*testf_*Jbar*w;
1814  jacobian(local_eqn,local_unknown) +=
1815  r*base_flow_p*group_F(l,l2)*w;
1816  jacobian(local_eqn,local_unknown) -=
1817  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*group_F(l,l2)*w;
1818  jacobian(local_eqn,local_unknown) -=
1819  visc_ratio*(1.0+Gamma[0])*r*group_C[l2]*dtestfdr*w;
1820  jacobian(local_eqn,local_unknown) +=
1821  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr*group_A[l2]
1822  *dtestfdr*w;
1823  jacobian(local_eqn,local_unknown) +=
1824  visc_ratio*k*k*base_flow_durdz*psif[l2]*testf_*Jbar*w/r;
1825  jacobian(local_eqn,local_unknown) +=
1826  visc_ratio*Gamma[0]*r*base_flow_duzdr*dtestfdz*group_A[l2]*w;
1827  jacobian(local_eqn,local_unknown) -=
1828  visc_ratio*Gamma[0]*r*group_D[l2]*dtestfdz*w;
1829  jacobian(local_eqn,local_unknown) +=
1830  visc_ratio*r*base_flow_durdz*group_A[l2]*dtestfdz*w;
1831  jacobian(local_eqn,local_unknown) -=
1832  scaled_re_st*r*base_flow_durdt*testf_*group_A[l2]*w;
1833  jacobian(local_eqn,local_unknown) +=
1834  scaled_re*base_flow_utheta*base_flow_utheta*testf_
1835  *group_A[l2]*w;
1836  jacobian(local_eqn,local_unknown) +=
1837  r*body_force[0]*testf_*group_A[l2]*w;
1838  jacobian(local_eqn,local_unknown) +=
1839  scaled_re_inv_fr*r*G[0]*testf_*group_A[l2]*w;
1840  jacobian(local_eqn,local_unknown) +=
1841  base_flow_p*testf_*group_A[l2]*w;
1842  jacobian(local_eqn,local_unknown) -=
1843  visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*group_A[l2]*w/r;
1844  }
1845 
1846  } // End of loop over velocity shape functions
1847 
1848  // Now loop over pressure shape functions
1849  // (This is the contribution from pressure gradient)
1850  for(unsigned l2=0;l2<n_pres;l2++)
1851  {
1852  // Cosine part P_k^C has no contribution
1853 
1854  // Sine part P_k^S
1855  local_unknown = p_local_eqn(l2,1);
1856  if(local_unknown >= 0)
1857  {
1858  jacobian(local_eqn,local_unknown) += r*psip[l2]*dtestfdr*Jbar*w;
1859  jacobian(local_eqn,local_unknown) += psip[l2]*testf_*Jbar*w;
1860  }
1861  } // End of loop over pressure shape functions
1862 
1863  // Now loop over the spines in the element
1864  for(unsigned l2=0;l2<n_p;l2++)
1865  {
1866  // Perturbed spine "height" (cosine part) H_k^C
1867  local_unknown =
1869 
1870  if(local_unknown >= 0)
1871  {
1872  for(unsigned a=0;a<3;a++)
1873  {
1874  double sum = 0.0;
1875 
1876  sum -=
1877  k*scaled_re*base_flow_utheta*base_flow_durdz
1878  *psif[l2+(3*a)]*testf_*Jbar*w;
1879  sum -=
1880  k*visc_ratio*Gamma[0]*base_flow_duthetadr*dtestfdz
1881  *psif[l2+(3*a)]*Jbar*w;
1882  sum -= k*visc_ratio*Gamma[0]*group_E[l2+(3*a)]*testf_*w;
1883  sum +=
1884  visc_ratio*k*base_flow_utheta*dtestfdz*psif[l2+(3*a)]
1885  *Jbar*w/r;
1886  sum -=
1887  visc_ratio*(1.0+Gamma[0])*k*base_flow_duthetadz
1888  *psif[l2+(3*a)]*testf_*Jbar*w/r;
1889  sum +=
1890  k*visc_ratio*base_flow_utheta*testf_*group_A[l2+(3*a)]*w/r;
1891 
1892  jacobian(local_eqn,local_unknown) +=
1893  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
1894  }
1895  }
1896 
1897  // Perturbed spine "height" (sine part) H_k^S
1898  local_unknown =
1900 
1901  if(local_unknown >= 0)
1902  {
1903  for(unsigned a=0;a<3;a++)
1904  {
1905  double sum = 0.0;
1906 
1907  sum -= scaled_re*r*base_flow_ur*group_C[l2+(3*a)]*testf_*w;
1908  sum +=
1909  scaled_re_st*r*mesh_velocity[0]*group_C[l2+(3*a)]*testf_*w;
1910  sum +=
1911  scaled_re_st*r*psif[l2+(3*a)]
1912  *node_pt(l2+(3*a))->position_time_stepper_pt()->weight(1,0)
1913  *base_flow_durdz*testf_*Jbar*w;
1914  sum += r*base_flow_p*group_F(l,(l2+(3*a)))*w;
1915  sum -=
1916  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr
1917  *group_F(l,(l2+(3*a)))*w;
1918  sum -=
1919  visc_ratio*(1.0+Gamma[0])*r*group_C[l2+(3*a)]*dtestfdr*w;
1920  sum +=
1921  visc_ratio*(1.0+Gamma[0])*r*base_flow_durdr
1922  *group_A[l2+(3*a)]*dtestfdr*w;
1923  sum +=
1924  visc_ratio*k*k*base_flow_durdz*psif[l2+(3*a)]*testf_*Jbar*w/r;
1925  sum -= visc_ratio*Gamma[0]*r*group_D[l2+(3*a)]*dtestfdz*w;
1926  sum +=
1927  visc_ratio*Gamma[0]*r*base_flow_duzdr*group_A[l2+(3*a)]
1928  *dtestfdz*w;
1929  sum +=
1930  visc_ratio*r*base_flow_durdz*group_A[l2+(3*a)]*dtestfdz*w;
1931  sum -=
1932  scaled_re_st*r*base_flow_durdt*testf_*group_A[l2+(3*a)]*w;
1933  sum +=
1934  scaled_re*base_flow_utheta*base_flow_utheta*testf_
1935  *group_A[l2+(3*a)]*w;
1936  sum += r*body_force[0]*testf_*group_A[l2+(3*a)]*w;
1937  sum += scaled_re_inv_fr*r*G[0]*testf_*group_A[l2+(3*a)]*w;
1938  sum += base_flow_p*testf_*group_A[l2+(3*a)]*w;
1939  sum -=
1940  visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_
1941  *group_A[l2+(3*a)]*w/r;
1942 
1943  jacobian(local_eqn,local_unknown) +=
1944  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
1945  }
1946  }
1947  } // End of loop over spines in the element
1948  } // End of Jacobian calculation
1949 
1950  } // End of if not boundary condition statement
1951 
1952  // --------------------------------------------
1953  // THIRD (AXIAL) MOMENTUM EQUATION: COSINE PART
1954  // --------------------------------------------
1955 
1956  // Get local equation number of third velocity value at this node
1957  local_eqn = nodal_local_eqn(l,u_nodal_index[2]);
1958 
1959  // If it's not a boundary condition
1960  if(local_eqn >= 0)
1961  {
1962  residuals[local_eqn] -= scaled_re_st*r*dWCdt*testf_*Jbar*w;
1963  residuals[local_eqn] -=
1964  scaled_re_st*interpolated_RC*base_flow_duzdt*testf_*Jbar*w;
1965  residuals[local_eqn] -=
1966  scaled_re*r*base_flow_ur*interpolated_dWdRC*testf_*Jbar*w;
1967  residuals[local_eqn] +=
1968  scaled_re_st*r*mesh_velocity[0]*interpolated_dWdRC*testf_*Jbar*w;
1969  residuals[local_eqn] -=
1970  scaled_re*r*interpolated_UC*base_flow_duzdr*testf_*Jbar*w;
1971  residuals[local_eqn] +=
1972  scaled_re_st*r*dRCdt*base_flow_duzdr*testf_*Jbar*w;
1973  residuals[local_eqn] -=
1974  scaled_re*interpolated_RC*base_flow_ur*base_flow_duzdr*testf_*Jbar*w;
1975  residuals[local_eqn] +=
1976  scaled_re_st*interpolated_RC*mesh_velocity[0]*base_flow_duzdr
1977  *testf_*Jbar*w;
1978  residuals[local_eqn] -=
1979  k*scaled_re*base_flow_utheta*interpolated_WS*testf_*Jbar*w;
1980  residuals[local_eqn] +=
1981  k*scaled_re*base_flow_utheta*base_flow_duzdr*interpolated_RS
1982  *testf_*Jbar*w;
1983  residuals[local_eqn] +=
1984  k*scaled_re*base_flow_utheta*base_flow_duzdz*interpolated_ZS
1985  *testf_*Jbar*w;
1986  residuals[local_eqn] -=
1987  scaled_re*r*base_flow_uz*interpolated_dWdZC*testf_*Jbar*w;
1988  residuals[local_eqn] +=
1989  scaled_re_st*r*mesh_velocity[1]*interpolated_dWdZC*testf_*Jbar*w;
1990  residuals[local_eqn] -=
1991  scaled_re*r*interpolated_WC*base_flow_duzdz*testf_*Jbar*w;
1992  residuals[local_eqn] +=
1993  scaled_re_st*r*dZCdt*base_flow_duzdz*testf_*Jbar*w;
1994  residuals[local_eqn] -=
1995  scaled_re*interpolated_RC*base_flow_uz*base_flow_duzdz*testf_*Jbar*w;
1996  residuals[local_eqn] +=
1997  scaled_re_st*interpolated_RC*mesh_velocity[1]*base_flow_duzdz
1998  *testf_*Jbar*w;
1999  residuals[local_eqn] += interpolated_RC*body_force[1]*testf_*Jbar*w;
2000  residuals[local_eqn] +=
2001  scaled_re_inv_fr*interpolated_RC*G[1]*testf_*Jbar*w;
2002  residuals[local_eqn] -= visc_ratio*r*base_flow_duzdr*dtestfdRC*Jbar*w;
2003  residuals[local_eqn] -=
2004  visc_ratio*r*interpolated_dWdRC*dtestfdr*Jbar*w;
2005  residuals[local_eqn] += visc_ratio*r*base_flow_duzdr*JhatC*dtestfdr*w;
2006  residuals[local_eqn] -=
2007  visc_ratio*interpolated_RC*base_flow_duzdr*dtestfdr*Jbar*w;
2008  residuals[local_eqn] -=
2009  visc_ratio*Gamma[1]*r*base_flow_durdz*dtestfdRC*Jbar*w;
2010  residuals[local_eqn] -=
2011  visc_ratio*Gamma[1]*r*interpolated_dUdZC*dtestfdr*Jbar*w;
2012  residuals[local_eqn] +=
2013  visc_ratio*Gamma[1]*r*base_flow_durdz*JhatC*dtestfdr*w;
2014  residuals[local_eqn] -=
2015  visc_ratio*Gamma[1]*interpolated_RC*base_flow_durdz*dtestfdr*Jbar*w;
2016  residuals[local_eqn] -= visc_ratio*k*k*interpolated_WC*testf_*Jbar*w/r;
2017  residuals[local_eqn] +=
2018  visc_ratio*k*k*base_flow_duzdr*interpolated_RC*testf_*Jbar*w/r;
2019  residuals[local_eqn] +=
2020  visc_ratio*k*k*base_flow_duzdz*interpolated_ZC*testf_*Jbar*w/r;
2021  residuals[local_eqn] +=
2022  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdr*interpolated_RS
2023  *Jbar*w;
2024  residuals[local_eqn] +=
2025  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdz*interpolated_ZS
2026  *Jbar*w;
2027  residuals[local_eqn] +=
2028  k*visc_ratio*Gamma[1]*interpolated_dVdZS*testf_*Jbar*w;
2029  residuals[local_eqn] += r*base_flow_p*dtestfdZC*Jbar*w;
2030  residuals[local_eqn] += r*interpolated_PC*dtestfdz*Jbar*w;
2031  residuals[local_eqn] += interpolated_RC*base_flow_p*dtestfdz*Jbar*w;
2032  residuals[local_eqn] -=
2033  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*dtestfdZC*Jbar*w;
2034  residuals[local_eqn] -=
2035  visc_ratio*(1.0+Gamma[1])*r*interpolated_dWdZC*dtestfdz*Jbar*w;
2036  residuals[local_eqn] +=
2037  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*JhatC*dtestfdz*w;
2038  residuals[local_eqn] -=
2039  visc_ratio*(1.0+Gamma[1])*interpolated_RC*base_flow_duzdz
2040  *dtestfdz*Jbar*w;
2041  residuals[local_eqn] -= scaled_re_st*r*base_flow_duzdt*testf_*JhatC*w;
2042  residuals[local_eqn] += r*body_force[1]*testf_*JhatC*w;
2043  residuals[local_eqn] += scaled_re_inv_fr*r*G[1]*testf_*JhatC*w;
2044 
2045 
2046  // Calculate the Jacobian
2047  // ----------------------
2048 
2049  if(flag)
2050  {
2051  // Loop over the velocity shape functions again
2052  for(unsigned l2=0;l2<n_node;l2++)
2053  {
2054  // Radial velocity component (cosine part) U_k^C
2055  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
2056  if(local_unknown >= 0)
2057  {
2058  jacobian(local_eqn,local_unknown) -=
2059  scaled_re*r*psif[l2]*base_flow_duzdr*testf_*Jbar*w;
2060  jacobian(local_eqn,local_unknown) -=
2061  visc_ratio*Gamma[1]*r*group_A[l2]*dtestfdr*w;
2062  }
2063 
2064  // Radial velocity component (sine part) U_k^S
2065  // has no contribution
2066 
2067  // Axial velocity component (cosine part) W_k^C
2068  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
2069  if(local_unknown >= 0)
2070  {
2071  if(flag==2)
2072  {
2073  // Add the mass matrix
2074  mass_matrix(local_eqn,local_unknown) +=
2075  scaled_re_st*r*psif[l2]*testf_*Jbar*w;
2076  }
2077 
2078  // Add contributions to the Jacobian matrix
2079  jacobian(local_eqn,local_unknown) -=
2080  scaled_re_st*r*psif[l2]
2081  *node_pt(l2)->time_stepper_pt()->weight(1,0)*testf_*Jbar*w;
2082  jacobian(local_eqn,local_unknown) -=
2083  scaled_re*r*base_flow_ur*group_B[l2]*testf_*w;
2084  jacobian(local_eqn,local_unknown) +=
2085  scaled_re_st*r*mesh_velocity[0]*group_B[l2]*testf_*w;
2086  jacobian(local_eqn,local_unknown) -=
2087  scaled_re*r*base_flow_uz*group_A[l2]*testf_*w;
2088  jacobian(local_eqn,local_unknown) +=
2089  scaled_re_st*r*mesh_velocity[1]*group_A[l2]*testf_*w;
2090  jacobian(local_eqn,local_unknown) -=
2091  scaled_re*r*psif[l2]*base_flow_duzdz*testf_*Jbar*w;
2092  jacobian(local_eqn,local_unknown) -=
2093  visc_ratio*r*group_B[l2]*dtestfdr*w;
2094  jacobian(local_eqn,local_unknown) -=
2095  visc_ratio*k*k*psif[l2]*testf_*Jbar*w/r;
2096  jacobian(local_eqn,local_unknown) -=
2097  visc_ratio*(1.0+Gamma[1])*r*group_A[l2]*dtestfdz*w;
2098  }
2099 
2100  // Axial velocity component (sine part) W_k^S
2101  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
2102  if(local_unknown >= 0)
2103  {
2104  jacobian(local_eqn,local_unknown) -=
2105  k*scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
2106  }
2107 
2108  // Azimuthal velocity component (cosine part) V_k^C
2109  // has no contribution
2110 
2111  // Azimuthal velocity component (sine part) V_k^S
2112  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
2113  if(local_unknown >= 0)
2114  {
2115  jacobian(local_eqn,local_unknown) +=
2116  k*visc_ratio*Gamma[1]*group_A[l2]*testf_*w;
2117  }
2118 
2119  // Perturbation to radial nodal coord (cosine part) R_k^C
2120  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[0]);
2121  if(local_unknown >= 0)
2122  {
2123  jacobian(local_eqn,local_unknown) -=
2124  scaled_re_st*psif[l2]*base_flow_duzdt*testf_*Jbar*w;
2125  jacobian(local_eqn,local_unknown) +=
2126  scaled_re_st*r*psif[l2]
2128  *base_flow_duzdr*testf_*Jbar*w;
2129  jacobian(local_eqn,local_unknown) -=
2130  scaled_re*psif[l2]*base_flow_ur*base_flow_duzdr*testf_*Jbar*w;
2131  jacobian(local_eqn,local_unknown) +=
2132  scaled_re_st*psif[l2]*mesh_velocity[0]*base_flow_duzdr
2133  *testf_*Jbar*w;
2134  jacobian(local_eqn,local_unknown) +=
2135  scaled_re*r*base_flow_uz*group_D[l2]*testf_*w;
2136  jacobian(local_eqn,local_unknown) -=
2137  scaled_re_st*r*mesh_velocity[1]*group_D[l2]*testf_*w;
2138  jacobian(local_eqn,local_unknown) -=
2139  scaled_re*psif[l2]*base_flow_uz*base_flow_duzdz*testf_*Jbar*w;
2140  jacobian(local_eqn,local_unknown) +=
2141  scaled_re_st*psif[l2]*mesh_velocity[1]*base_flow_duzdz
2142  *testf_*Jbar*w;
2143  jacobian(local_eqn,local_unknown) +=
2144  psif[l2]*body_force[1]*testf_*Jbar*w;
2145  jacobian(local_eqn,local_unknown) +=
2146  scaled_re_inv_fr*psif[l2]*G[1]*testf_*Jbar*w;
2147  jacobian(local_eqn,local_unknown) +=
2148  visc_ratio*r*base_flow_duzdr*group_B[l2]*dtestfdr*w;
2149  jacobian(local_eqn,local_unknown) -=
2150  visc_ratio*psif[l2]*base_flow_duzdr*dtestfdr*Jbar*w;
2151  jacobian(local_eqn,local_unknown) +=
2152  visc_ratio*Gamma[1]*r*group_C[l2]*dtestfdr*w;
2153  jacobian(local_eqn,local_unknown) +=
2154  visc_ratio*Gamma[1]*r*base_flow_durdz*group_B[l2]*dtestfdr*w;
2155  jacobian(local_eqn,local_unknown) -=
2156  visc_ratio*Gamma[1]*psif[l2]*base_flow_durdz*dtestfdr*Jbar*w;
2157  jacobian(local_eqn,local_unknown) +=
2158  visc_ratio*k*k*base_flow_duzdr*psif[l2]*testf_*Jbar*w/r;
2159  jacobian(local_eqn,local_unknown) -=
2160  r*base_flow_p*group_F(l,l2)*w;
2161  jacobian(local_eqn,local_unknown) +=
2162  psif[l2]*base_flow_p*dtestfdz*Jbar*w;
2163  jacobian(local_eqn,local_unknown) +=
2164  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*group_F(l,l2)*w;
2165  jacobian(local_eqn,local_unknown) +=
2166  visc_ratio*(1.0+Gamma[1])*r*group_D[l2]*dtestfdz*w;
2167  jacobian(local_eqn,local_unknown) +=
2168  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*group_B[l2]
2169  *dtestfdz*w;
2170  jacobian(local_eqn,local_unknown) -=
2171  visc_ratio*(1.0+Gamma[1])*psif[l2]*base_flow_duzdz*dtestfdz
2172  *Jbar*w;
2173  jacobian(local_eqn,local_unknown) -=
2174  scaled_re_st*r*base_flow_duzdt*testf_*group_B[l2]*w;
2175  jacobian(local_eqn,local_unknown) +=
2176  r*body_force[1]*testf_*group_B[l2]*w;
2177  jacobian(local_eqn,local_unknown) +=
2178  scaled_re_inv_fr*r*G[1]*testf_*group_B[l2]*w;
2179  }
2180 
2181  // Perturbation to radial nodal coord (sine part) R_k^S
2182  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[1]);
2183  if(local_unknown >= 0)
2184  {
2185  jacobian(local_eqn,local_unknown) +=
2186  k*scaled_re*base_flow_utheta*base_flow_duzdr*psif[l2]*testf_
2187  *Jbar*w;
2188  jacobian(local_eqn,local_unknown) +=
2189  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdr*psif[l2]
2190  *Jbar*w;
2191  jacobian(local_eqn,local_unknown) -=
2192  k*visc_ratio*Gamma[1]*group_E[l2]*testf_*w;
2193  }
2194 
2195  // Perturbation to axial nodal coord (cosine part) Z_k^C
2196  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[2]);
2197  if(local_unknown >= 0)
2198  {
2199  jacobian(local_eqn,local_unknown) -=
2200  scaled_re*r*base_flow_ur*group_D[l2]*testf_*w;
2201  jacobian(local_eqn,local_unknown) +=
2202  scaled_re_st*r*mesh_velocity[0]*group_D[l2]*testf_*w;
2203  jacobian(local_eqn,local_unknown) +=
2204  scaled_re_st*r*psif[l2]
2206  *base_flow_duzdz*testf_*Jbar*w;
2207  jacobian(local_eqn,local_unknown) -=
2208  visc_ratio*r*base_flow_duzdr*group_F(l,l2)*w;
2209  jacobian(local_eqn,local_unknown) -=
2210  visc_ratio*r*group_D[l2]*dtestfdr*w;
2211  jacobian(local_eqn,local_unknown) +=
2212  visc_ratio*r*base_flow_duzdr*group_A[l2]*dtestfdr*w;
2213  jacobian(local_eqn,local_unknown) -=
2214  visc_ratio*Gamma[1]*r*base_flow_durdz*group_F(l,l2)*w;
2215  jacobian(local_eqn,local_unknown) +=
2216  visc_ratio*Gamma[1]*r*base_flow_durdz*group_A[l2]*dtestfdr*w;
2217  jacobian(local_eqn,local_unknown) +=
2218  visc_ratio*k*k*base_flow_duzdz*psif[l2]*testf_*Jbar*w/r;
2219  jacobian(local_eqn,local_unknown) +=
2220  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*group_A[l2]
2221  *dtestfdz*w;
2222  jacobian(local_eqn,local_unknown) -=
2223  scaled_re_st*r*base_flow_duzdt*testf_*group_A[l2]*w;
2224  jacobian(local_eqn,local_unknown) +=
2225  r*body_force[1]*testf_*group_A[l2]*w;
2226  jacobian(local_eqn,local_unknown) +=
2227  scaled_re_inv_fr*r*G[1]*testf_*group_A[l2]*w;
2228  }
2229 
2230  // Perturbation to axial nodal coord (sine part) Z_k^S
2231  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[3]);
2232  if(local_unknown >= 0)
2233  {
2234  jacobian(local_eqn,local_unknown) +=
2235  k*scaled_re*base_flow_utheta*base_flow_duzdz*psif[l2]
2236  *testf_*Jbar*w;
2237  jacobian(local_eqn,local_unknown) +=
2238  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdz
2239  *psif[l2]*Jbar*w;
2240  }
2241 
2242  } // End of loop over velocity shape functions
2243 
2244  // Now loop over pressure shape functions
2245  // (This is the contribution from pressure gradient)
2246  for(unsigned l2=0;l2<n_pres;l2++)
2247  {
2248  // Cosine part P_k^C
2249  local_unknown = p_local_eqn(l2,0);
2250  if(local_unknown >= 0)
2251  {
2252  jacobian(local_eqn,local_unknown) += r*psip[l2]*dtestfdz*Jbar*w;
2253  }
2254 
2255  // Sine part P_k^S has no contribution
2256 
2257  } // End of loop over pressure shape functions
2258 
2259  // Now loop over the spines in the element
2260  for(unsigned l2=0;l2<n_p;l2++)
2261  {
2262  // Perturbed spine "height" (cosine part) H_k^C
2263  local_unknown =
2265 
2266  if(local_unknown >= 0)
2267  {
2268  for(unsigned a=0;a<3;a++)
2269  {
2270  double sum = 0.0;
2271 
2272  sum -= scaled_re*r*base_flow_ur*group_D[l2+(3*a)]*testf_*w;
2273  sum +=
2274  scaled_re_st*r*mesh_velocity[0]*group_D[l2+(3*a)]*testf_*w;
2275  sum +=
2276  scaled_re_st*r*psif[l2+(3*a)]
2277  *node_pt(l2+(3*a))->position_time_stepper_pt()->weight(1,0)
2278  *base_flow_duzdz*testf_*Jbar*w;
2279  sum -= visc_ratio*r*base_flow_duzdr*group_F(l,(l2+(3*a)))*w;
2280  sum -= visc_ratio*r*group_D[l2+(3*a)]*dtestfdr*w;
2281  sum +=
2282  visc_ratio*r*base_flow_duzdr*group_A[l2+(3*a)]*dtestfdr*w;
2283  sum -=
2284  visc_ratio*Gamma[1]*r*base_flow_durdz*group_F(l,(l2+(3*a)))*w;
2285  sum +=
2286  visc_ratio*Gamma[1]*r*base_flow_durdz*group_A[l2+(3*a)]
2287  *dtestfdr*w;
2288  sum +=
2289  visc_ratio*k*k*base_flow_duzdz*psif[l2+(3*a)]*testf_*Jbar*w/r;
2290  sum +=
2291  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz
2292  *group_A[l2+(3*a)]*dtestfdz*w;
2293  sum -=
2294  scaled_re_st*r*base_flow_duzdt*testf_*group_A[l2+(3*a)]*w;
2295  sum += r*body_force[1]*testf_*group_A[l2+(3*a)]*w;
2296  sum += scaled_re_inv_fr*r*G[1]*testf_*group_A[l2+(3*a)]*w;
2297 
2298  jacobian(local_eqn,local_unknown) +=
2299  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
2300  }
2301  }
2302 
2303  // Perturbed spine "height" (sine part) H_k^S
2304  local_unknown =
2306 
2307  if(local_unknown >= 0)
2308  {
2309  for(unsigned a=0;a<3;a++)
2310  {
2311  double sum = 0.0;
2312 
2313  sum += k*scaled_re*base_flow_utheta*base_flow_duzdz
2314  *psif[l2+(3*a)]*testf_*Jbar*w;
2315  sum += k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdz
2316  *psif[l2+(3*a)]*Jbar*w;
2317 
2318  jacobian(local_eqn,local_unknown) +=
2319  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
2320  }
2321  }
2322  } // End of loop over spines in the element
2323 
2324  } // End of Jacobian calculation
2325 
2326  } // End of if not boundary condition statement
2327 
2328  // -------------------------------------------
2329  // FOURTH (AXIAL) MOMENTUM EQUATION: SINE PART
2330  // -------------------------------------------
2331 
2332  // Get local equation number of fourth velocity value at this node
2333  local_eqn = nodal_local_eqn(l,u_nodal_index[3]);
2334 
2335  // If it's not a boundary condition
2336  if(local_eqn >= 0)
2337  {
2338  residuals[local_eqn] -= scaled_re_st*r*dWSdt*testf_*Jbar*w;
2339  residuals[local_eqn] -=
2340  scaled_re_st*interpolated_RS*base_flow_duzdt*testf_*Jbar*w;
2341  residuals[local_eqn] -=
2342  scaled_re*r*base_flow_ur*interpolated_dWdRS*testf_*Jbar*w;
2343  residuals[local_eqn] +=
2344  scaled_re_st*r*mesh_velocity[0]*interpolated_dWdRS*testf_*Jbar*w;
2345  residuals[local_eqn] -=
2346  scaled_re*r*interpolated_US*base_flow_duzdr*testf_*Jbar*w;
2347  residuals[local_eqn] +=
2348  scaled_re_st*r*dRSdt*base_flow_duzdr*testf_*Jbar*w;
2349  residuals[local_eqn] -=
2350  scaled_re*interpolated_RS*base_flow_ur*base_flow_duzdr*testf_*Jbar*w;
2351  residuals[local_eqn] +=
2352  scaled_re_st*interpolated_RS*mesh_velocity[0]*base_flow_duzdr
2353  *testf_*Jbar*w;
2354  residuals[local_eqn] +=
2355  k*scaled_re*base_flow_utheta*interpolated_WC*testf_*Jbar*w;
2356  residuals[local_eqn] -=
2357  k*scaled_re*base_flow_utheta*base_flow_duzdr*interpolated_RC
2358  *testf_*Jbar*w;
2359  residuals[local_eqn] -=
2360  k*scaled_re*base_flow_utheta*base_flow_duzdz*interpolated_ZC
2361  *testf_*Jbar*w;
2362  residuals[local_eqn] -=
2363  scaled_re*r*base_flow_uz*interpolated_dWdZS*testf_*Jbar*w;
2364  residuals[local_eqn] +=
2365  scaled_re_st*r*mesh_velocity[1]*interpolated_dWdZS*testf_*Jbar*w;
2366  residuals[local_eqn] -=
2367  scaled_re*r*interpolated_WS*base_flow_duzdz*testf_*Jbar*w;
2368  residuals[local_eqn] +=
2369  scaled_re_st*r*dZSdt*base_flow_duzdz*testf_*Jbar*w;
2370  residuals[local_eqn] -=
2371  scaled_re*interpolated_RS*base_flow_uz*base_flow_duzdz*testf_*Jbar*w;
2372  residuals[local_eqn] +=
2373  scaled_re_st*interpolated_RS*mesh_velocity[1]*base_flow_duzdz
2374  *testf_*Jbar*w;
2375  residuals[local_eqn] += interpolated_RS*body_force[1]*testf_*Jbar*w;
2376  residuals[local_eqn] +=
2377  scaled_re_inv_fr*interpolated_RS*G[1]*testf_*Jbar*w;
2378  residuals[local_eqn] -= visc_ratio*r*base_flow_duzdr*dtestfdRS*Jbar*w;
2379  residuals[local_eqn] -=
2380  visc_ratio*r*interpolated_dWdRS*dtestfdr*Jbar*w;
2381  residuals[local_eqn] += visc_ratio*r*base_flow_duzdr*JhatS*dtestfdr*w;
2382  residuals[local_eqn] -=
2383  visc_ratio*interpolated_RS*base_flow_duzdr*dtestfdr*Jbar*w;
2384  residuals[local_eqn] -=
2385  visc_ratio*Gamma[1]*r*base_flow_durdz*dtestfdRS*Jbar*w;
2386  residuals[local_eqn] -=
2387  visc_ratio*Gamma[1]*r*interpolated_dUdZS*dtestfdr*Jbar*w;
2388  residuals[local_eqn] +=
2389  visc_ratio*Gamma[1]*r*base_flow_durdz*JhatS*dtestfdr*w;
2390  residuals[local_eqn] -=
2391  visc_ratio*Gamma[1]*interpolated_RS*base_flow_durdz*dtestfdr*Jbar*w;
2392  residuals[local_eqn] -= visc_ratio*k*k*interpolated_WS*testf_*Jbar*w/r;
2393  residuals[local_eqn] +=
2394  visc_ratio*k*k*base_flow_duzdr*interpolated_RS*testf_*Jbar*w/r;
2395  residuals[local_eqn] +=
2396  visc_ratio*k*k*base_flow_duzdz*interpolated_ZS*testf_*Jbar*w/r;
2397  residuals[local_eqn] -=
2398  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdr*interpolated_RC
2399  *Jbar*w;
2400  residuals[local_eqn] -=
2401  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdz*interpolated_ZC
2402  *Jbar*w;
2403  residuals[local_eqn] -=
2404  k*visc_ratio*Gamma[1]*interpolated_dVdZC*testf_*Jbar*w;
2405  residuals[local_eqn] += r*base_flow_p*dtestfdZS*Jbar*w;
2406  residuals[local_eqn] += r*interpolated_PS*dtestfdz*Jbar*w;
2407  residuals[local_eqn] += interpolated_RS*base_flow_p*dtestfdz*Jbar*w;
2408  residuals[local_eqn] -=
2409  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*dtestfdZS*Jbar*w;
2410  residuals[local_eqn] -=
2411  visc_ratio*(1.0+Gamma[1])*r*interpolated_dWdZS*dtestfdz*Jbar*w;
2412  residuals[local_eqn] +=
2413  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*JhatS*dtestfdz*w;
2414  residuals[local_eqn] -=
2415  visc_ratio*(1.0+Gamma[1])*interpolated_RS*base_flow_duzdz*dtestfdz
2416  *Jbar*w;
2417  residuals[local_eqn] -= scaled_re_st*r*base_flow_duzdt*testf_*JhatS*w;
2418  residuals[local_eqn] += r*body_force[1]*testf_*JhatS*w;
2419  residuals[local_eqn] += scaled_re_inv_fr*r*G[1]*testf_*JhatS*w;
2420 
2421 
2422  // Calculate the Jacobian
2423  // ----------------------
2424 
2425  if(flag)
2426  {
2427  // Loop over the velocity shape functions again
2428  for(unsigned l2=0;l2<n_node;l2++)
2429  {
2430  // Radial velocity component (cosine part) U_k^C
2431  // has no contribution
2432 
2433  // Radial velocity component (sine part) U_k^S
2434  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
2435  if(local_unknown >= 0)
2436  {
2437  jacobian(local_eqn,local_unknown) -=
2438  scaled_re*r*psif[l2]*base_flow_duzdr*testf_*Jbar*w;
2439  jacobian(local_eqn,local_unknown) -=
2440  visc_ratio*Gamma[1]*r*group_A[l2]*dtestfdr*w;
2441  }
2442 
2443  // Axial velocity component (cosine part) W_k^S
2444  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
2445  if(local_unknown >= 0)
2446  {
2447  jacobian(local_eqn,local_unknown) +=
2448  k*scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
2449  }
2450 
2451  // Axial velocity component (sine part) W_k^S
2452  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
2453  if(local_unknown >= 0)
2454  {
2455  if(flag==2)
2456  {
2457  // Add the mass matrix
2458  mass_matrix(local_eqn,local_unknown) +=
2459  scaled_re_st*r*psif[l2]*testf_*Jbar*w;
2460  }
2461 
2462  // Add contributions to the Jacobian matrix
2463  jacobian(local_eqn,local_unknown) -=
2464  scaled_re_st*r*psif[l2]
2465  *node_pt(l2)->time_stepper_pt()->weight(1,0)*testf_*Jbar*w;
2466  jacobian(local_eqn,local_unknown) -=
2467  scaled_re*r*base_flow_ur*group_B[l2]*testf_*w;
2468  jacobian(local_eqn,local_unknown) +=
2469  scaled_re_st*r*mesh_velocity[0]*group_B[l2]*testf_*w;
2470  jacobian(local_eqn,local_unknown) -=
2471  scaled_re*r*base_flow_uz*group_A[l2]*testf_*w;
2472  jacobian(local_eqn,local_unknown) +=
2473  scaled_re_st*r*mesh_velocity[1]*group_A[l2]*testf_*w;
2474  jacobian(local_eqn,local_unknown) -=
2475  scaled_re*r*psif[l2]*base_flow_duzdz*testf_*Jbar*w;
2476  jacobian(local_eqn,local_unknown) -=
2477  visc_ratio*r*group_B[l2]*dtestfdr*w;
2478  jacobian(local_eqn,local_unknown) -=
2479  visc_ratio*k*k*psif[l2]*testf_*Jbar*w/r;
2480  jacobian(local_eqn,local_unknown) -=
2481  visc_ratio*(1.0+Gamma[1])*r*group_A[l2]*dtestfdz*w;
2482  }
2483 
2484  // Azimuthal velocity component (cosine part) V_k^C
2485  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
2486  if(local_unknown >= 0)
2487  {
2488  jacobian(local_eqn,local_unknown) -=
2489  k*visc_ratio*Gamma[1]*group_A[l2]*testf_*w;
2490  }
2491 
2492  // Azimuthal velocity component (sine part) V_k^S
2493  // has no contribution
2494 
2495  // Perturbation to radial nodal coord (cosine part) R_k^C
2496  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[0]);
2497  if(local_unknown >= 0)
2498  {
2499  jacobian(local_eqn,local_unknown) -=
2500  k*scaled_re*base_flow_utheta*base_flow_duzdr*psif[l2]
2501  *testf_*Jbar*w;
2502  jacobian(local_eqn,local_unknown) -=
2503  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdr
2504  *psif[l2]*Jbar*w;
2505  jacobian(local_eqn,local_unknown) +=
2506  k*visc_ratio*Gamma[1]*group_E[l2]*testf_*w;
2507  }
2508 
2509  // Perturbation to radial nodal coord (sine part) R_k^S
2510  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[1]);
2511  if(local_unknown >= 0)
2512  {
2513  jacobian(local_eqn,local_unknown) -=
2514  scaled_re_st*psif[l2]*base_flow_duzdt*testf_*Jbar*w;
2515  jacobian(local_eqn,local_unknown) +=
2516  scaled_re_st*r*psif[l2]
2518  *base_flow_duzdr*testf_*Jbar*w;
2519  jacobian(local_eqn,local_unknown) -=
2520  scaled_re*psif[l2]*base_flow_ur*base_flow_duzdr*testf_*Jbar*w;
2521  jacobian(local_eqn,local_unknown) +=
2522  scaled_re_st*psif[l2]*mesh_velocity[0]*base_flow_duzdr
2523  *testf_*Jbar*w;
2524  jacobian(local_eqn,local_unknown) +=
2525  scaled_re*r*base_flow_uz*group_D[l2]*testf_*w;
2526  jacobian(local_eqn,local_unknown) -=
2527  scaled_re_st*r*mesh_velocity[1]*group_D[l2]*testf_*w;
2528  jacobian(local_eqn,local_unknown) -=
2529  scaled_re*psif[l2]*base_flow_uz*base_flow_duzdz*testf_*Jbar*w;
2530  jacobian(local_eqn,local_unknown) +=
2531  scaled_re_st*psif[l2]*mesh_velocity[1]*base_flow_duzdz
2532  *testf_*Jbar*w;
2533  jacobian(local_eqn,local_unknown) +=
2534  psif[l2]*body_force[1]*testf_*Jbar*w;
2535  jacobian(local_eqn,local_unknown) +=
2536  scaled_re_inv_fr*psif[l2]*G[1]*testf_*Jbar*w;
2537  jacobian(local_eqn,local_unknown) +=
2538  visc_ratio*r*base_flow_duzdr*group_B[l2]*dtestfdr*w;
2539  jacobian(local_eqn,local_unknown) -=
2540  visc_ratio*psif[l2]*base_flow_duzdr*dtestfdr*Jbar*w;
2541  jacobian(local_eqn,local_unknown) +=
2542  visc_ratio*Gamma[1]*r*group_C[l2]*dtestfdr*w;
2543  jacobian(local_eqn,local_unknown) +=
2544  visc_ratio*Gamma[1]*r*base_flow_durdz*group_B[l2]*dtestfdr*w;
2545  jacobian(local_eqn,local_unknown) -=
2546  visc_ratio*Gamma[1]*psif[l2]*base_flow_durdz*dtestfdr*Jbar*w;
2547  jacobian(local_eqn,local_unknown) +=
2548  visc_ratio*k*k*base_flow_duzdr*psif[l2]*testf_*Jbar*w/r;
2549  jacobian(local_eqn,local_unknown) -=
2550  r*base_flow_p*group_F(l,l2)*w;
2551  jacobian(local_eqn,local_unknown) +=
2552  psif[l2]*base_flow_p*dtestfdz*Jbar*w;
2553  jacobian(local_eqn,local_unknown) +=
2554  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*group_F(l,l2)*w;
2555  jacobian(local_eqn,local_unknown) +=
2556  visc_ratio*(1.0+Gamma[1])*r*group_D[l2]*dtestfdz*w;
2557  jacobian(local_eqn,local_unknown) +=
2558  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*group_B[l2]
2559  *dtestfdz*w;
2560  jacobian(local_eqn,local_unknown) -=
2561  visc_ratio*(1.0+Gamma[1])*psif[l2]*base_flow_duzdz
2562  *dtestfdz*Jbar*w;
2563  jacobian(local_eqn,local_unknown) -=
2564  scaled_re_st*r*base_flow_duzdt*testf_*group_B[l2]*w;
2565  jacobian(local_eqn,local_unknown) +=
2566  r*body_force[1]*testf_*group_B[l2]*w;
2567  jacobian(local_eqn,local_unknown) +=
2568  scaled_re_inv_fr*r*G[1]*testf_*group_B[l2]*w;
2569  }
2570 
2571  // Perturbation to axial nodal coord (cosine part) Z_k^C
2572  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[2]);
2573  if(local_unknown >= 0)
2574  {
2575  jacobian(local_eqn,local_unknown) -=
2576  k*scaled_re*base_flow_utheta*base_flow_duzdz*psif[l2]
2577  *testf_*Jbar*w;
2578  jacobian(local_eqn,local_unknown) -=
2579  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdz
2580  *psif[l2]*Jbar*w;
2581  }
2582 
2583  // Perturbation to axial nodal coord (sine part) Z_k^S
2584  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[3]);
2585  if(local_unknown >= 0)
2586  {
2587  jacobian(local_eqn,local_unknown) -=
2588  scaled_re*r*base_flow_ur*group_D[l2]*testf_*w;
2589  jacobian(local_eqn,local_unknown) +=
2590  scaled_re_st*r*mesh_velocity[0]*group_D[l2]*testf_*w;
2591  jacobian(local_eqn,local_unknown) +=
2592  scaled_re_st*r*psif[l2]
2594  *base_flow_duzdz*testf_*Jbar*w;
2595  jacobian(local_eqn,local_unknown) -=
2596  visc_ratio*r*base_flow_duzdr*group_F(l,l2)*w;
2597  jacobian(local_eqn,local_unknown) -=
2598  visc_ratio*r*group_D[l2]*dtestfdr*w;
2599  jacobian(local_eqn,local_unknown) +=
2600  visc_ratio*r*base_flow_duzdr*group_A[l2]*dtestfdr*w;
2601  jacobian(local_eqn,local_unknown) -=
2602  visc_ratio*Gamma[1]*r*base_flow_durdz*group_F(l,l2)*w;
2603  jacobian(local_eqn,local_unknown) +=
2604  visc_ratio*Gamma[1]*r*base_flow_durdz*group_A[l2]*dtestfdr*w;
2605  jacobian(local_eqn,local_unknown) +=
2606  visc_ratio*k*k*base_flow_duzdz*psif[l2]*testf_*Jbar*w/r;
2607  jacobian(local_eqn,local_unknown) +=
2608  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz*group_A[l2]
2609  *dtestfdz*w;
2610  jacobian(local_eqn,local_unknown) -=
2611  scaled_re_st*r*base_flow_duzdt*testf_*group_A[l2]*w;
2612  jacobian(local_eqn,local_unknown) +=
2613  r*body_force[1]*testf_*group_A[l2]*w;
2614  jacobian(local_eqn,local_unknown) +=
2615  scaled_re_inv_fr*r*G[1]*testf_*group_A[l2]*w;
2616  }
2617 
2618  } // End of loop over velocity shape functions
2619 
2620  // Now loop over pressure shape functions
2621  // (This is the contribution from pressure gradient)
2622  for(unsigned l2=0;l2<n_pres;l2++)
2623  {
2624  // Cosine part P_k^C has no contribution
2625 
2626  // Sine part P_k^S
2627  local_unknown = p_local_eqn(l2,1);
2628  if(local_unknown >= 0)
2629  {
2630  jacobian(local_eqn,local_unknown) += r*psip[l2]*dtestfdz*Jbar*w;
2631  }
2632  } // End of loop over pressure shape functions
2633 
2634  // Now loop over the spines in the element
2635  for(unsigned l2=0;l2<n_p;l2++)
2636  {
2637  // Perturbed spine "height" (cosine part) H_k^C
2638  local_unknown =
2640 
2641  if(local_unknown >= 0)
2642  {
2643  for(unsigned a=0;a<3;a++)
2644  {
2645  double sum = 0.0;
2646 
2647  sum -=
2648  k*scaled_re*base_flow_utheta*base_flow_duzdz
2649  *psif[l2+(3*a)]*testf_*Jbar*w;
2650  sum -=
2651  k*visc_ratio*Gamma[1]*base_flow_duthetadz*dtestfdz
2652  *psif[l2+(3*a)]*Jbar*w;
2653 
2654  jacobian(local_eqn,local_unknown) +=
2655  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
2656  }
2657  }
2658 
2659  // Perturbed spine "height" (sine part) H_k^S
2660  local_unknown =
2662 
2663  if(local_unknown >= 0)
2664  {
2665  for(unsigned a=0;a<3;a++)
2666  {
2667  double sum = 0.0;
2668 
2669  sum -= scaled_re*r*base_flow_ur*group_D[l2+(3*a)]*testf_*w;
2670  sum +=
2671  scaled_re_st*r*mesh_velocity[0]*group_D[l2+(3*a)]*testf_*w;
2672  sum +=
2673  scaled_re_st*r*psif[l2+(3*a)]
2674  *node_pt(l2+(3*a))->position_time_stepper_pt()->weight(1,0)
2675  *base_flow_duzdz*testf_*Jbar*w;
2676  sum -= visc_ratio*r*base_flow_duzdr*group_F(l,(l2+(3*a)))*w;
2677  sum -= visc_ratio*r*group_D[l2+(3*a)]*dtestfdr*w;
2678  sum +=
2679  visc_ratio*r*base_flow_duzdr*group_A[l2+(3*a)]*dtestfdr*w;
2680  sum -=
2681  visc_ratio*Gamma[1]*r*base_flow_durdz*group_F(l,(l2+(3*a)))*w;
2682  sum +=
2683  visc_ratio*Gamma[1]*r*base_flow_durdz*group_A[l2+(3*a)]
2684  *dtestfdr*w;
2685  sum +=
2686  visc_ratio*k*k*base_flow_duzdz*psif[l2+(3*a)]*testf_*Jbar*w/r;
2687  sum +=
2688  visc_ratio*(1.0+Gamma[1])*r*base_flow_duzdz
2689  *group_A[l2+(3*a)]*dtestfdz*w;
2690  sum -=
2691  scaled_re_st*r*base_flow_duzdt*testf_*group_A[l2+(3*a)]*w;
2692  sum += r*body_force[1]*testf_*group_A[l2+(3*a)]*w;
2693  sum += scaled_re_inv_fr*r*G[1]*testf_*group_A[l2+(3*a)]*w;
2694 
2695  jacobian(local_eqn,local_unknown) +=
2696  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
2697  }
2698  }
2699  } // End of loop over spines in the element
2700 
2701  } // End of Jacobian calculation
2702 
2703  } // End of if not boundary condition statement
2704 
2705  // ------------------------------------------------
2706  // FIFTH (AZIMUTHAL) MOMENTUM EQUATION: COSINE PART
2707  // ------------------------------------------------
2708 
2709  //if(offensive_eqn>=0) cout<<"residuals[offensive_eqn] = "<<residuals[offensive_eqn]<<endl;
2710 
2711  // Get local equation number of fifth velocity value at this node
2712  local_eqn = nodal_local_eqn(l,u_nodal_index[4]);
2713 
2714  // If it's not a boundary condition
2715  if(local_eqn >= 0)
2716  {
2717  residuals[local_eqn] -= scaled_re_st*r*dVCdt*testf_*Jbar*w;
2718  residuals[local_eqn] -=
2719  scaled_re_st*interpolated_RC*base_flow_duthetadt*testf_*Jbar*w;
2720  residuals[local_eqn] -=
2721  scaled_re*r*base_flow_ur*interpolated_dVdRC*testf_*Jbar*w;
2722  residuals[local_eqn] +=
2723  scaled_re_st*r*mesh_velocity[0]*interpolated_dVdRC*testf_*Jbar*w;
2724  residuals[local_eqn] -=
2725  scaled_re*r*interpolated_UC*base_flow_duthetadr*testf_*Jbar*w;
2726  residuals[local_eqn] +=
2727  scaled_re_st*r*dRCdt*base_flow_duthetadr*testf_*Jbar*w;
2728  residuals[local_eqn] -=
2729  scaled_re*interpolated_RC*base_flow_ur*base_flow_duthetadr
2730  *testf_*Jbar*w;
2731  residuals[local_eqn] +=
2732  scaled_re_st*interpolated_RC*mesh_velocity[0]*base_flow_duthetadr
2733  *testf_*Jbar*w;
2734  residuals[local_eqn] -=
2735  k*scaled_re*base_flow_utheta*interpolated_VS*testf_*Jbar*w;
2736  residuals[local_eqn] +=
2737  k*scaled_re*base_flow_utheta*base_flow_duthetadr*interpolated_RS
2738  *testf_*Jbar*w;
2739  residuals[local_eqn] +=
2740  k*scaled_re*base_flow_utheta*base_flow_duthetadz*interpolated_ZS
2741  *testf_*Jbar*w;
2742  residuals[local_eqn] -=
2743  scaled_re*base_flow_utheta*interpolated_UC*testf_*Jbar*w;
2744  residuals[local_eqn] -=
2745  scaled_re*interpolated_VC*base_flow_ur*testf_*Jbar*w;
2746  residuals[local_eqn] -=
2747  scaled_re*r*base_flow_uz*interpolated_dVdZC*testf_*Jbar*w;
2748  residuals[local_eqn] +=
2749  scaled_re_st*r*mesh_velocity[1]*interpolated_dVdZC*testf_*Jbar*w;
2750  residuals[local_eqn] -=
2751  scaled_re*r*interpolated_WC*base_flow_duthetadz*testf_*Jbar*w;
2752  residuals[local_eqn] +=
2753  scaled_re_st*r*dZCdt*base_flow_duthetadz*testf_*Jbar*w;
2754  residuals[local_eqn] -=
2755  scaled_re*interpolated_RC*base_flow_uz*base_flow_duthetadz
2756  *testf_*Jbar*w;
2757  residuals[local_eqn] +=
2758  scaled_re_st*interpolated_RC*mesh_velocity[1]*base_flow_duthetadz
2759  *testf_*Jbar*w;
2760  residuals[local_eqn] += interpolated_RC*body_force[2]*testf_*Jbar*w;
2761  residuals[local_eqn] +=
2762  scaled_re_inv_fr*interpolated_RC*G[2]*testf_*Jbar*w;
2763  residuals[local_eqn] -=
2764  visc_ratio*r*base_flow_duthetadr*dtestfdRC*Jbar*w;
2765  residuals[local_eqn] -=
2766  visc_ratio*r*interpolated_dVdRC*dtestfdr*Jbar*w;
2767  residuals[local_eqn] +=
2768  visc_ratio*r*base_flow_duthetadr*JhatC*dtestfdr*w;
2769  residuals[local_eqn] -=
2770  visc_ratio*interpolated_RC*base_flow_duthetadr*dtestfdr*Jbar*w;
2771  residuals[local_eqn] -=
2772  k*visc_ratio*Gamma[0]*interpolated_US*dtestfdr*Jbar*w;
2773  residuals[local_eqn] +=
2774  k*visc_ratio*Gamma[0]*base_flow_durdr*interpolated_RS*dtestfdr*Jbar*w;
2775  residuals[local_eqn] +=
2776  k*visc_ratio*Gamma[0]*base_flow_durdz*interpolated_ZS*dtestfdr*Jbar*w;
2777  residuals[local_eqn] +=
2778  visc_ratio*Gamma[0]*base_flow_utheta*dtestfdRC*Jbar*w;
2779  residuals[local_eqn] +=
2780  visc_ratio*Gamma[0]*interpolated_VC*dtestfdr*Jbar*w;
2781  residuals[local_eqn] -= k*base_flow_p*dtestfdr*interpolated_RS*Jbar*w;
2782  residuals[local_eqn] -= k*base_flow_p*dtestfdz*interpolated_ZS*Jbar*w;
2783  residuals[local_eqn] -= k*interpolated_PS*testf_*Jbar*w;
2784  residuals[local_eqn] -=
2785  visc_ratio*(1.0+Gamma[0])*k*k*interpolated_VC*testf_*Jbar*w/r;
2786  residuals[local_eqn] +=
2787  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadr*interpolated_RC
2788  *testf_*Jbar*w/r;
2789  residuals[local_eqn] +=
2790  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadz*interpolated_ZC
2791  *testf_*Jbar*w/r;
2792  residuals[local_eqn] +=
2793  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdr*interpolated_RS
2794  *Jbar*w/r;
2795  residuals[local_eqn] +=
2796  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdz*interpolated_ZS
2797  *Jbar*w/r;
2798  residuals[local_eqn] +=
2799  visc_ratio*(1.0+Gamma[0])*k*interpolated_US*testf_*Jbar*w/r;
2800  residuals[local_eqn] -=
2801  visc_ratio*(1.0+Gamma[0])*k*interpolated_RS*base_flow_ur*testf_
2802  *Jbar*w/(r*r);
2803  residuals[local_eqn] -=
2804  k*visc_ratio*Gamma[0]*interpolated_WS*dtestfdz*Jbar*w;
2805  residuals[local_eqn] +=
2806  k*visc_ratio*Gamma[0]*base_flow_duzdr*interpolated_RS*dtestfdz*Jbar*w;
2807  residuals[local_eqn] +=
2808  k*visc_ratio*Gamma[0]*base_flow_duzdz*interpolated_ZS*dtestfdz*Jbar*w;
2809  residuals[local_eqn] -=
2810  visc_ratio*r*base_flow_duthetadz*dtestfdZC*Jbar*w;
2811  residuals[local_eqn] -=
2812  visc_ratio*r*interpolated_dVdZC*dtestfdz*Jbar*w;
2813  residuals[local_eqn] +=
2814  visc_ratio*r*base_flow_duthetadz*JhatC*dtestfdz*w;
2815  residuals[local_eqn] -=
2816  visc_ratio*interpolated_RC*base_flow_duthetadz*dtestfdz*Jbar*w;
2817  residuals[local_eqn] +=
2818  visc_ratio*Gamma[0]*interpolated_dVdRC*testf_*Jbar*w;
2819  residuals[local_eqn] += visc_ratio*k*interpolated_US*testf_*Jbar*w/r;
2820  residuals[local_eqn] -=
2821  visc_ratio*k*base_flow_durdr*interpolated_RS*testf_*Jbar*w/r;
2822  residuals[local_eqn] -=
2823  visc_ratio*k*base_flow_durdz*interpolated_ZS*testf_*Jbar*w/r;
2824  residuals[local_eqn] -= visc_ratio*interpolated_VC*testf_*Jbar*w/r;
2825  residuals[local_eqn] +=
2826  visc_ratio*base_flow_utheta*interpolated_RC*testf_*Jbar*w/(r*r);
2827  residuals[local_eqn] -=
2828  scaled_re_st*r*base_flow_duthetadt*testf_*JhatC*w;
2829  residuals[local_eqn] -=
2830  scaled_re*base_flow_utheta*base_flow_ur*testf_*JhatC*w;
2831  residuals[local_eqn] += r*body_force[2]*testf_*JhatC*w;
2832  residuals[local_eqn] += scaled_re_inv_fr*r*G[2]*testf_*JhatC*w;
2833  residuals[local_eqn] -= k*base_flow_p*testf_*JhatS*w;
2834  residuals[local_eqn] +=
2835  k*visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*JhatS*w/r;
2836  residuals[local_eqn] -= visc_ratio*base_flow_utheta*testf_*JhatC*w/r;
2837 
2838 
2839  // Calculate the Jacobian
2840  // ----------------------
2841 
2842  if(flag)
2843  {
2844  // Loop over the velocity shape functions again
2845  for(unsigned l2=0;l2<n_node;l2++)
2846  {
2847  // Radial velocity component (cosine part) U_k^C
2848  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
2849  if(local_unknown >= 0)
2850  {
2851  jacobian(local_eqn,local_unknown) -=
2852  scaled_re*r*psif[l2]*base_flow_duthetadr*testf_*Jbar*w;
2853  jacobian(local_eqn,local_unknown) -=
2854  scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
2855  }
2856 
2857  // Radial velocity component (sine part) U_k^S
2858  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
2859  if(local_unknown >= 0)
2860  {
2861  jacobian(local_eqn,local_unknown) -=
2862  k*visc_ratio*Gamma[0]*psif[l2]*dtestfdr*Jbar*w;
2863  jacobian(local_eqn,local_unknown) +=
2864  visc_ratio*(1.0+Gamma[0])*k*psif[l2]*testf_*Jbar*w/r;
2865  jacobian(local_eqn,local_unknown) +=
2866  visc_ratio*k*psif[l2]*testf_*Jbar*w/r;
2867  }
2868 
2869  // Axial velocity component (cosine part) W_k^C
2870  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
2871  if(local_unknown >= 0)
2872  {
2873  jacobian(local_eqn,local_unknown) -=
2874  scaled_re*r*psif[l2]*base_flow_duthetadz*testf_*Jbar*w;
2875  }
2876 
2877  // Axial velocity component (sine part) W_k^S
2878  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
2879  if(local_unknown >= 0)
2880  {
2881  jacobian(local_eqn,local_unknown) -=
2882  k*visc_ratio*Gamma[0]*psif[l2]*dtestfdz*Jbar*w;
2883  }
2884 
2885  // Azimuthal velocity component (cosine part) V_k^C
2886  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
2887  if(local_unknown >= 0)
2888  {
2889  if(flag==2)
2890  {
2891  // Add the mass matrix
2892  mass_matrix(local_eqn,local_unknown) +=
2893  scaled_re_st*r*psif[l2]*testf_*Jbar*w;
2894  }
2895 
2896  // Add contributions to the Jacobian matrix
2897  jacobian(local_eqn,local_unknown) -=
2898  scaled_re_st*r*psif[l2]
2899  *node_pt(l2)->time_stepper_pt()->weight(1,0)*testf_*Jbar*w;
2900  jacobian(local_eqn,local_unknown) -=
2901  scaled_re*r*base_flow_ur*group_B[l2]*testf_*w;
2902  jacobian(local_eqn,local_unknown) +=
2903  scaled_re_st*r*mesh_velocity[0]*group_B[l2]*testf_*w;
2904  jacobian(local_eqn,local_unknown) -=
2905  scaled_re*psif[l2]*base_flow_ur*testf_*Jbar*w;
2906  jacobian(local_eqn,local_unknown) -=
2907  scaled_re*r*base_flow_uz*group_A[l2]*testf_*w;
2908  jacobian(local_eqn,local_unknown) +=
2909  scaled_re_st*r*mesh_velocity[1]*group_A[l2]*testf_*w;
2910  jacobian(local_eqn,local_unknown) -=
2911  visc_ratio*r*group_B[l2]*dtestfdr*w;
2912  jacobian(local_eqn,local_unknown) +=
2913  visc_ratio*Gamma[0]*psif[l2]*dtestfdr*Jbar*w;
2914  jacobian(local_eqn,local_unknown) -=
2915  visc_ratio*(1.0+Gamma[0])*k*k*psif[l2]*testf_*Jbar*w/r;
2916  jacobian(local_eqn,local_unknown) -=
2917  visc_ratio*r*group_A[l2]*dtestfdz*w;
2918  jacobian(local_eqn,local_unknown) +=
2919  visc_ratio*Gamma[0]*group_B[l2]*testf_*w;
2920  jacobian(local_eqn,local_unknown) -=
2921  visc_ratio*psif[l2]*testf_*Jbar*w/r;
2922  }
2923 
2924  // Azimuthal velocity component (sine part) V_k^S
2925  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
2926  if(local_unknown >= 0)
2927  {
2928  jacobian(local_eqn,local_unknown) -=
2929  k*scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
2930  }
2931 
2932  // Perturbation to radial nodal coord (cosine part) R_k^C
2933  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[0]);
2934  if(local_unknown >= 0)
2935  {
2936  jacobian(local_eqn,local_unknown) -=
2937  scaled_re_st*psif[l2]*base_flow_duthetadt*testf_*Jbar*w;
2938  jacobian(local_eqn,local_unknown) +=
2939  scaled_re_st*r*psif[l2]
2941  *base_flow_duthetadr*testf_*Jbar*w;
2942  jacobian(local_eqn,local_unknown) -=
2943  scaled_re*psif[l2]*base_flow_ur*base_flow_duthetadr*testf_
2944  *Jbar*w;
2945  jacobian(local_eqn,local_unknown) +=
2946  scaled_re_st*psif[l2]*mesh_velocity[0]*base_flow_duthetadr
2947  *testf_*Jbar*w;
2948  jacobian(local_eqn,local_unknown) +=
2949  scaled_re*r*base_flow_uz*group_E[l2]*testf_*w;
2950  jacobian(local_eqn,local_unknown) -=
2951  scaled_re_st*r*mesh_velocity[1]*group_E[l2]*testf_*w;
2952  jacobian(local_eqn,local_unknown) -=
2953  scaled_re*psif[l2]*base_flow_uz*base_flow_duthetadz
2954  *testf_*Jbar*w;
2955  jacobian(local_eqn,local_unknown) +=
2956  scaled_re_st*psif[l2]*mesh_velocity[1]*base_flow_duthetadz
2957  *testf_*Jbar*w;
2958  jacobian(local_eqn,local_unknown) +=
2959  psif[l2]*body_force[2]*testf_*Jbar*w;
2960  jacobian(local_eqn,local_unknown) +=
2961  scaled_re_inv_fr*psif[l2]*G[2]*testf_*Jbar*w;
2962  jacobian(local_eqn,local_unknown) +=
2963  visc_ratio*r*base_flow_duthetadr*group_B[l2]*dtestfdr*w;
2964  jacobian(local_eqn,local_unknown) -=
2965  visc_ratio*psif[l2]*base_flow_duthetadr*dtestfdr*Jbar*w;
2966  jacobian(local_eqn,local_unknown) +=
2967  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadr
2968  *psif[l2]*testf_*Jbar*w/r;
2969  jacobian(local_eqn,local_unknown) +=
2970  visc_ratio*r*base_flow_duthetadz*group_F(l,l2)*w;
2971  jacobian(local_eqn,local_unknown) +=
2972  visc_ratio*r*group_E[l2]*dtestfdz*w;
2973  jacobian(local_eqn,local_unknown) +=
2974  visc_ratio*r*base_flow_duthetadz*group_B[l2]*dtestfdz*w;
2975  jacobian(local_eqn,local_unknown) -=
2976  visc_ratio*psif[l2]*base_flow_duthetadz*dtestfdz*Jbar*w;
2977  jacobian(local_eqn,local_unknown) +=
2978  visc_ratio*base_flow_utheta*psif[l2]*testf_*Jbar*w/(r*r);
2979  jacobian(local_eqn,local_unknown) -=
2980  scaled_re_st*r*base_flow_duthetadt*testf_*group_B[l2]*w;
2981  jacobian(local_eqn,local_unknown) -=
2982  scaled_re*base_flow_utheta*base_flow_ur*testf_*group_B[l2]*w;
2983  jacobian(local_eqn,local_unknown) +=
2984  r*body_force[2]*testf_*group_B[l2]*w;
2985  jacobian(local_eqn,local_unknown) +=
2986  scaled_re_inv_fr*r*G[2]*testf_*group_B[l2]*w;
2987  jacobian(local_eqn,local_unknown) -=
2988  visc_ratio*base_flow_utheta*testf_*group_B[l2]*w/r;
2989  }
2990 
2991  // Perturbation to radial nodal coord (sine part) R_k^S
2992  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[1]);
2993  if(local_unknown >= 0)
2994  {
2995  jacobian(local_eqn,local_unknown) +=
2996  k*scaled_re*base_flow_utheta*base_flow_duthetadr*psif[l2]
2997  *testf_*Jbar*w;
2998  jacobian(local_eqn,local_unknown) +=
2999  k*visc_ratio*Gamma[0]*base_flow_durdr*psif[l2]*dtestfdr*Jbar*w;
3000  jacobian(local_eqn,local_unknown) -=
3001  k*base_flow_p*dtestfdr*psif[l2]*Jbar*w;
3002  jacobian(local_eqn,local_unknown) +=
3003  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdr*psif[l2]
3004  *Jbar*w/r;
3005  jacobian(local_eqn,local_unknown) -=
3006  visc_ratio*(1.0+Gamma[0])*k*psif[l2]*base_flow_ur*testf_
3007  *Jbar*w/(r*r);
3008  jacobian(local_eqn,local_unknown) +=
3009  k*visc_ratio*Gamma[0]*base_flow_duzdr*psif[l2]*dtestfdz*Jbar*w;
3010  jacobian(local_eqn,local_unknown) -=
3011  visc_ratio*k*base_flow_durdr*psif[l2]*testf_*Jbar*w/r;
3012  jacobian(local_eqn,local_unknown) -=
3013  k*base_flow_p*testf_*group_B[l2]*w;
3014  jacobian(local_eqn,local_unknown) +=
3015  k*visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*group_B[l2]*w/r;
3016  }
3017 
3018  // Perturbation to axial nodal coord (cosine part) Z_k^C
3019  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[2]);
3020  if(local_unknown >= 0)
3021  {
3022  jacobian(local_eqn,local_unknown) -=
3023  scaled_re*r*base_flow_ur*group_E[l2]*testf_*w;
3024  jacobian(local_eqn,local_unknown) +=
3025  scaled_re_st*r*mesh_velocity[0]*group_E[l2]*testf_*w;
3026  jacobian(local_eqn,local_unknown) +=
3027  scaled_re_st*r*psif[l2]
3029  *base_flow_duthetadz*testf_*Jbar*w;
3030  jacobian(local_eqn,local_unknown) -=
3031  visc_ratio*r*base_flow_duthetadr*group_F(l,l2)*w;
3032  jacobian(local_eqn,local_unknown) -=
3033  visc_ratio*r*group_E[l2]*dtestfdr*w;
3034  jacobian(local_eqn,local_unknown) +=
3035  visc_ratio*r*base_flow_duthetadr*group_A[l2]*dtestfdr*w;
3036  jacobian(local_eqn,local_unknown) +=
3037  visc_ratio*Gamma[0]*base_flow_utheta*group_F(l,l2)*w;
3038  jacobian(local_eqn,local_unknown) +=
3039  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadz*psif[l2]
3040  *testf_*Jbar*w/r;
3041  jacobian(local_eqn,local_unknown) +=
3042  visc_ratio*r*base_flow_duthetadz*group_A[l2]*dtestfdz*w;
3043  jacobian(local_eqn,local_unknown) +=
3044  visc_ratio*Gamma[0]*group_E[l2]*testf_*w;
3045  jacobian(local_eqn,local_unknown) -=
3046  scaled_re_st*r*base_flow_duthetadt*testf_*group_A[l2]*w;
3047  jacobian(local_eqn,local_unknown) -=
3048  scaled_re*base_flow_utheta*base_flow_ur*testf_*group_A[l2]*w;
3049  jacobian(local_eqn,local_unknown) +=
3050  r*body_force[2]*testf_*group_A[l2]*w;
3051  jacobian(local_eqn,local_unknown) +=
3052  scaled_re_inv_fr*r*G[2]*testf_*group_A[l2]*w;
3053  jacobian(local_eqn,local_unknown) -=
3054  visc_ratio*base_flow_utheta*testf_*group_A[l2]*w/r;
3055  }
3056 
3057  // Perturbation to axial nodal coord (sine part) Z_k^S
3058  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[3]);
3059  if(local_unknown >= 0)
3060  {
3061  jacobian(local_eqn,local_unknown) +=
3062  k*scaled_re*base_flow_utheta*base_flow_duthetadz*psif[l2]
3063  *testf_*Jbar*w;
3064  jacobian(local_eqn,local_unknown) +=
3065  k*visc_ratio*Gamma[0]*base_flow_durdz*psif[l2]*dtestfdr*Jbar*w;
3066  jacobian(local_eqn,local_unknown) -=
3067  k*base_flow_p*dtestfdz*psif[l2]*Jbar*w;
3068  jacobian(local_eqn,local_unknown) +=
3069  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdz*psif[l2]
3070  *Jbar*w/r;
3071  jacobian(local_eqn,local_unknown) +=
3072  k*visc_ratio*Gamma[0]*base_flow_duzdz*psif[l2]*dtestfdz*Jbar*w;
3073  jacobian(local_eqn,local_unknown) -=
3074  visc_ratio*k*base_flow_durdz*psif[l2]*testf_*Jbar*w/r;
3075  jacobian(local_eqn,local_unknown) -=
3076  k*base_flow_p*testf_*group_A[l2]*w;
3077  jacobian(local_eqn,local_unknown) +=
3078  k*visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*group_A[l2]*w/r;
3079  }
3080 
3081  } // End of loop over velocity shape functions
3082 
3083  // Now loop over pressure shape functions
3084  // (This is the contribution from pressure gradient)
3085  for(unsigned l2=0;l2<n_pres;l2++)
3086  {
3087  // Cosine part P_k^C has no contribution
3088 
3089  // Sine part P_k^S
3090  local_unknown = p_local_eqn(l2,1);
3091  if(local_unknown >= 0)
3092  {
3093  jacobian(local_eqn,local_unknown) -= k*psip[l2]*testf_*Jbar*w;
3094  }
3095  } // End of loop over pressure shape functions
3096 
3097  // Now loop over the spines in the element
3098  for(unsigned l2=0;l2<n_p;l2++)
3099  {
3100  // Perturbed spine "height" (cosine part) H_k^C
3101  local_unknown =
3103 
3104  if(local_unknown >= 0)
3105  {
3106  for(unsigned a=0;a<3;a++)
3107  {
3108  double sum = 0.0;
3109 
3110  sum -= scaled_re*r*base_flow_ur*group_E[l2+(3*a)]*testf_*w;
3111  sum +=
3112  scaled_re_st*r*mesh_velocity[0]*group_E[l2+(3*a)]*testf_*w;
3113  sum +=
3114  scaled_re_st*r*psif[l2+(3*a)]
3115  *node_pt(l2+(3*a))->position_time_stepper_pt()->weight(1,0)
3116  *base_flow_duthetadz*testf_*Jbar*w;
3117  sum -=
3118  visc_ratio*r*base_flow_duthetadr*group_F(l,(l2+(3*a)))*w;
3119  sum -= visc_ratio*r*group_E[l2+(3*a)]*dtestfdr*w;
3120  sum +=
3121  visc_ratio*r*base_flow_duthetadr*group_A[l2+(3*a)]*dtestfdr*w;
3122  sum +=
3123  visc_ratio*Gamma[0]*base_flow_utheta*group_F(l,(l2+(3*a)))*w;
3124  sum +=
3125  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadz
3126  *psif[l2+(3*a)]*testf_*Jbar*w/r;
3127  sum +=
3128  visc_ratio*r*base_flow_duthetadz*group_A[l2+(3*a)]*dtestfdz*w;
3129  sum += visc_ratio*Gamma[0]*group_E[l2+(3*a)]*testf_*w;
3130  sum -=
3131  scaled_re_st*r*base_flow_duthetadt*testf_*group_A[l2+(3*a)]*w;
3132  sum -=
3133  scaled_re*base_flow_utheta*base_flow_ur*testf_
3134  *group_A[l2+(3*a)]*w;
3135  sum += r*body_force[2]*testf_*group_A[l2+(3*a)]*w;
3136  sum += scaled_re_inv_fr*r*G[2]*testf_*group_A[l2+(3*a)]*w;
3137  sum -=
3138  visc_ratio*base_flow_utheta*testf_*group_A[l2+(3*a)]*w/r;
3139 
3140  jacobian(local_eqn,local_unknown) +=
3141  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
3142  }
3143  }
3144 
3145  // Perturbed spine "height" (sine part) H_k^S
3146  local_unknown =
3148 
3149  if(local_unknown >= 0)
3150  {
3151  for(unsigned a=0;a<3;a++)
3152  {
3153  double sum = 0.0;
3154 
3155  sum +=
3156  k*scaled_re*base_flow_utheta*base_flow_duthetadz
3157  *psif[l2+(3*a)]*testf_*Jbar*w;
3158  sum +=
3159  k*visc_ratio*Gamma[0]*base_flow_durdz*psif[l2+(3*a)]
3160  *dtestfdr*Jbar*w;
3161  sum -= k*base_flow_p*dtestfdz*psif[l2+(3*a)]*Jbar*w;
3162  sum +=
3163  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdz
3164  *psif[l2+(3*a)]*Jbar*w/r;
3165  sum +=
3166  k*visc_ratio*Gamma[0]*base_flow_duzdz*psif[l2+(3*a)]
3167  *dtestfdz*Jbar*w;
3168  sum -=
3169  visc_ratio*k*base_flow_durdz*psif[l2+(3*a)]*testf_*Jbar*w/r;
3170  sum -= k*base_flow_p*testf_*group_A[l2+(3*a)]*w;
3171  sum +=
3172  k*visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_
3173  *group_A[l2+(3*a)]*w/r;
3174 
3175  jacobian(local_eqn,local_unknown) +=
3176  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
3177  }
3178  }
3179  } // End of loop over spines in the element
3180 
3181  } // End of Jacobian calculation
3182 
3183  } // End of if not boundary condition statement
3184 
3185  // ----------------------------------------------
3186  // SIXTH (AZIMUTHAL) MOMENTUM EQUATION: SINE PART
3187  // ----------------------------------------------
3188 
3189  //if(offensive_eqn>=0) cout<<"residuals[offensive_eqn] = "<<residuals[offensive_eqn]<<endl;
3190 
3191  // Get local equation number of sixth velocity value at this node
3192  local_eqn = nodal_local_eqn(l,u_nodal_index[5]);
3193 
3194  // If it's not a boundary condition
3195  if(local_eqn >= 0)
3196  {
3197  residuals[local_eqn] -= scaled_re_st*r*dVSdt*testf_*Jbar*w;
3198  residuals[local_eqn] -=
3199  scaled_re_st*interpolated_RS*base_flow_duthetadt*testf_*Jbar*w;
3200  residuals[local_eqn] -=
3201  scaled_re*r*base_flow_ur*interpolated_dVdRS*testf_*Jbar*w;
3202  residuals[local_eqn] +=
3203  scaled_re_st*r*mesh_velocity[0]*interpolated_dVdRS*testf_*Jbar*w;
3204  residuals[local_eqn] -=
3205  scaled_re*r*interpolated_US*base_flow_duthetadr*testf_*Jbar*w;
3206  residuals[local_eqn] +=
3207  scaled_re_st*r*dRSdt*base_flow_duthetadr*testf_*Jbar*w;
3208  residuals[local_eqn] -=
3209  scaled_re*interpolated_RS*base_flow_ur*base_flow_duthetadr
3210  *testf_*Jbar*w;
3211  residuals[local_eqn] +=
3212  scaled_re_st*interpolated_RS*mesh_velocity[0]*base_flow_duthetadr
3213  *testf_*Jbar*w;
3214  residuals[local_eqn] +=
3215  k*scaled_re*base_flow_utheta*interpolated_VC*testf_*Jbar*w;
3216  residuals[local_eqn] -=
3217  k*scaled_re*base_flow_utheta*base_flow_duthetadr*interpolated_RC
3218  *testf_*Jbar*w;
3219  residuals[local_eqn] -=
3220  k*scaled_re*base_flow_utheta*base_flow_duthetadz*interpolated_ZC
3221  *testf_*Jbar*w;
3222  residuals[local_eqn] -=
3223  scaled_re*base_flow_utheta*interpolated_US*testf_*Jbar*w;
3224  residuals[local_eqn] -=
3225  scaled_re*interpolated_VS*base_flow_ur*testf_*Jbar*w;
3226  residuals[local_eqn] -=
3227  scaled_re*r*base_flow_uz*interpolated_dVdZS*testf_*Jbar*w;
3228  residuals[local_eqn] +=
3229  scaled_re_st*r*mesh_velocity[1]*interpolated_dVdZS*testf_*Jbar*w;
3230  residuals[local_eqn] -=
3231  scaled_re*r*interpolated_WS*base_flow_duthetadz*testf_*Jbar*w;
3232  residuals[local_eqn] +=
3233  scaled_re_st*r*dZSdt*base_flow_duthetadz*testf_*Jbar*w;
3234  residuals[local_eqn] -=
3235  scaled_re*interpolated_RS*base_flow_uz*base_flow_duthetadz
3236  *testf_*Jbar*w;
3237  residuals[local_eqn] +=
3238  scaled_re_st*interpolated_RS*mesh_velocity[1]*base_flow_duthetadz
3239  *testf_*Jbar*w;
3240  residuals[local_eqn] += interpolated_RS*body_force[2]*testf_*Jbar*w;
3241  residuals[local_eqn] +=
3242  scaled_re_inv_fr*interpolated_RS*G[2]*testf_*Jbar*w;
3243  residuals[local_eqn] -=
3244  visc_ratio*r*base_flow_duthetadr*dtestfdRS*Jbar*w;
3245  residuals[local_eqn] -=
3246  visc_ratio*r*interpolated_dVdRS*dtestfdr*Jbar*w;
3247  residuals[local_eqn] +=
3248  visc_ratio*r*base_flow_duthetadr*JhatS*dtestfdr*w;
3249  residuals[local_eqn] -=
3250  visc_ratio*interpolated_RS*base_flow_duthetadr*dtestfdr*Jbar*w;
3251  residuals[local_eqn] +=
3252  k*visc_ratio*Gamma[0]*interpolated_UC*dtestfdr*Jbar*w;
3253  residuals[local_eqn] -=
3254  k*visc_ratio*Gamma[0]*base_flow_durdr*interpolated_RC*dtestfdr*Jbar*w;
3255  residuals[local_eqn] -=
3256  k*visc_ratio*Gamma[0]*base_flow_durdz*interpolated_ZC*dtestfdr*Jbar*w;
3257  residuals[local_eqn] +=
3258  visc_ratio*Gamma[0]*base_flow_utheta*dtestfdRS*Jbar*w;
3259  residuals[local_eqn] +=
3260  visc_ratio*Gamma[0]*interpolated_VS*dtestfdr*Jbar*w;
3261  residuals[local_eqn] += k*base_flow_p*dtestfdr*interpolated_RC*Jbar*w;
3262  residuals[local_eqn] += k*base_flow_p*dtestfdz*interpolated_ZC*Jbar*w;
3263  residuals[local_eqn] += k*interpolated_PC*testf_*Jbar*w;
3264  residuals[local_eqn] -=
3265  visc_ratio*(1.0+Gamma[0])*k*k*interpolated_VS*testf_*Jbar*w/r;
3266  residuals[local_eqn] +=
3267  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadr*interpolated_RS
3268  *testf_*Jbar*w/r;
3269  residuals[local_eqn] +=
3270  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadz*interpolated_ZS
3271  *testf_*Jbar*w/r;
3272  residuals[local_eqn] -=
3273  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdr*interpolated_RC
3274  *Jbar*w/r;
3275  residuals[local_eqn] -=
3276  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdz*interpolated_ZC
3277  *Jbar*w/r;
3278  residuals[local_eqn] -=
3279  visc_ratio*(1.0+Gamma[0])*k*interpolated_UC*testf_*Jbar*w/r;
3280  residuals[local_eqn] +=
3281  visc_ratio*(1.0+Gamma[0])*k*interpolated_RC*base_flow_ur
3282  *testf_*Jbar*w/(r*r);
3283  residuals[local_eqn] +=
3284  k*visc_ratio*Gamma[0]*interpolated_WC*dtestfdz*Jbar*w;
3285  residuals[local_eqn] -=
3286  k*visc_ratio*Gamma[0]*base_flow_duzdr*interpolated_RC*dtestfdz
3287  *Jbar*w;
3288  residuals[local_eqn] -=
3289  k*visc_ratio*Gamma[0]*base_flow_duzdz*interpolated_ZC*dtestfdz
3290  *Jbar*w;
3291  residuals[local_eqn] -=
3292  visc_ratio*r*base_flow_duthetadz*dtestfdZS*Jbar*w;
3293  residuals[local_eqn] -=
3294  visc_ratio*r*interpolated_dVdZS*dtestfdz*Jbar*w;
3295  residuals[local_eqn] +=
3296  visc_ratio*r*base_flow_duthetadz*JhatS*dtestfdz*w;
3297  residuals[local_eqn] -=
3298  visc_ratio*interpolated_RS*base_flow_duthetadz*dtestfdz*Jbar*w;
3299  residuals[local_eqn] +=
3300  visc_ratio*Gamma[0]*interpolated_dVdRS*testf_*Jbar*w;
3301  residuals[local_eqn] -= visc_ratio*k*interpolated_UC*testf_*Jbar*w/r;
3302  residuals[local_eqn] +=
3303  visc_ratio*k*base_flow_durdr*interpolated_RC*testf_*Jbar*w/r;
3304  residuals[local_eqn] +=
3305  visc_ratio*k*base_flow_durdz*interpolated_ZC*testf_*Jbar*w/r;
3306  residuals[local_eqn] -= visc_ratio*interpolated_VS*testf_*Jbar*w/r;
3307  residuals[local_eqn] +=
3308  visc_ratio*base_flow_utheta*interpolated_RS*testf_*Jbar*w/(r*r);
3309  residuals[local_eqn] -=
3310  scaled_re_st*r*base_flow_duthetadt*testf_*JhatS*w;
3311  residuals[local_eqn] -=
3312  scaled_re*base_flow_utheta*base_flow_ur*testf_*JhatS*w;
3313  residuals[local_eqn] += r*body_force[2]*testf_*JhatS*w;
3314  residuals[local_eqn] += scaled_re_inv_fr*r*G[2]*testf_*JhatS*w;
3315  residuals[local_eqn] += k*base_flow_p*testf_*JhatC*w;
3316  residuals[local_eqn] -=
3317  k*visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*JhatC*w/r;
3318  residuals[local_eqn] -= visc_ratio*base_flow_utheta*testf_*JhatS*w/r;
3319 
3320 
3321  // Calculate the Jacobian
3322  // ----------------------
3323 
3324  if(flag)
3325  {
3326  // Loop over the velocity shape functions again
3327  for(unsigned l2=0;l2<n_node;l2++)
3328  {
3329  // Radial velocity component (cosine part) U_k^C
3330  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
3331  if(local_unknown >= 0)
3332  {
3333  jacobian(local_eqn,local_unknown) +=
3334  k*visc_ratio*Gamma[0]*psif[l2]*dtestfdr*Jbar*w;
3335  jacobian(local_eqn,local_unknown) -=
3336  visc_ratio*(1.0+Gamma[0])*k*psif[l2]*testf_*Jbar*w/r;
3337  jacobian(local_eqn,local_unknown) -=
3338  visc_ratio*k*psif[l2]*testf_*Jbar*w/r;
3339  }
3340 
3341  // Radial velocity component (sine part) U_k^S
3342  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
3343  if(local_unknown >= 0)
3344  {
3345  jacobian(local_eqn,local_unknown) -=
3346  scaled_re*r*psif[l2]*base_flow_duthetadr*testf_*Jbar*w;
3347  jacobian(local_eqn,local_unknown) -=
3348  scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
3349  }
3350 
3351  // Axial velocity component (cosine part) W_k^C
3352  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
3353  if(local_unknown >= 0)
3354  {
3355  jacobian(local_eqn,local_unknown) +=
3356  k*visc_ratio*Gamma[0]*psif[l2]*dtestfdz*Jbar*w;
3357  }
3358 
3359  // Axial velocity component (sine part) W_k^S
3360  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
3361  if(local_unknown >= 0)
3362  {
3363  jacobian(local_eqn,local_unknown) -=
3364  scaled_re*r*psif[l2]*base_flow_duthetadz*testf_*Jbar*w;
3365  }
3366 
3367  // Azimuthal velocity component (cosine part) V_k^C
3368  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
3369  if(local_unknown >= 0)
3370  {
3371  jacobian(local_eqn,local_unknown) +=
3372  k*scaled_re*base_flow_utheta*psif[l2]*testf_*Jbar*w;
3373  }
3374 
3375  // Azimuthal velocity component (sine part) V_k^S
3376  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
3377  if(local_unknown >= 0)
3378  {
3379  if(flag==2)
3380  {
3381  // Add the mass matrix
3382  mass_matrix(local_eqn,local_unknown) +=
3383  scaled_re_st*r*psif[l2]*testf_*Jbar*w;
3384  }
3385 
3386  // Add contributions to the Jacobian matrix
3387  jacobian(local_eqn,local_unknown) -=
3388  scaled_re_st*r*psif[l2]
3389  *node_pt(l2)->time_stepper_pt()->weight(1,0)*testf_*Jbar*w;
3390  jacobian(local_eqn,local_unknown) -=
3391  scaled_re*r*base_flow_ur*group_B[l2]*testf_*w;
3392  jacobian(local_eqn,local_unknown) +=
3393  scaled_re_st*r*mesh_velocity[0]*group_B[l2]*testf_*w;
3394  jacobian(local_eqn,local_unknown) -=
3395  scaled_re*psif[l2]*base_flow_ur*testf_*Jbar*w;
3396  jacobian(local_eqn,local_unknown) -=
3397  scaled_re*r*base_flow_uz*group_A[l2]*testf_*w;
3398  jacobian(local_eqn,local_unknown) +=
3399  scaled_re_st*r*mesh_velocity[1]*group_A[l2]*testf_*w;
3400  jacobian(local_eqn,local_unknown) -=
3401  visc_ratio*r*group_B[l2]*dtestfdr*w;
3402  jacobian(local_eqn,local_unknown) +=
3403  visc_ratio*Gamma[0]*psif[l2]*dtestfdr*Jbar*w;
3404  jacobian(local_eqn,local_unknown) -=
3405  visc_ratio*(1.0+Gamma[0])*k*k*psif[l2]*testf_*Jbar*w/r;
3406  jacobian(local_eqn,local_unknown) -=
3407  visc_ratio*r*group_A[l2]*dtestfdz*w;
3408  jacobian(local_eqn,local_unknown) +=
3409  visc_ratio*Gamma[0]*group_B[l2]*testf_*w;
3410  jacobian(local_eqn,local_unknown) -=
3411  visc_ratio*psif[l2]*testf_*Jbar*w/r;
3412  }
3413 
3414  // Perturbation to radial nodal coord (cosine part) R_k^C
3415  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[0]);
3416  if(local_unknown >= 0)
3417  {
3418  jacobian(local_eqn,local_unknown) -=
3419  k*scaled_re*base_flow_utheta*base_flow_duthetadr
3420  *psif[l2]*testf_*Jbar*w;
3421  jacobian(local_eqn,local_unknown) -=
3422  k*visc_ratio*Gamma[0]*base_flow_durdr*psif[l2]*dtestfdr*Jbar*w;
3423  jacobian(local_eqn,local_unknown) +=
3424  k*base_flow_p*dtestfdr*psif[l2]*Jbar*w;
3425  jacobian(local_eqn,local_unknown) -=
3426  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdr
3427  *psif[l2]*Jbar*w/r;
3428  jacobian(local_eqn,local_unknown) +=
3429  visc_ratio*(1.0+Gamma[0])*k*psif[l2]*base_flow_ur
3430  *testf_*Jbar*w/(r*r);
3431  jacobian(local_eqn,local_unknown) -=
3432  k*visc_ratio*Gamma[0]*base_flow_duzdr*psif[l2]*dtestfdz*Jbar*w;
3433  jacobian(local_eqn,local_unknown) +=
3434  visc_ratio*k*base_flow_durdr*psif[l2]*testf_*Jbar*w/r;
3435  jacobian(local_eqn,local_unknown) +=
3436  k*base_flow_p*testf_*group_B[l2]*w;
3437  jacobian(local_eqn,local_unknown) -=
3438  k*visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_
3439  *group_B[l2]*w/r;
3440  }
3441 
3442  // Perturbation to radial nodal coord (sine part) R_k^S
3443  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[1]);
3444  if(local_unknown >= 0)
3445  {
3446  jacobian(local_eqn,local_unknown) -=
3447  scaled_re_st*psif[l2]*base_flow_duthetadt*testf_*Jbar*w;
3448  jacobian(local_eqn,local_unknown) +=
3449  scaled_re_st*r*psif[l2]
3451  *base_flow_duthetadr*testf_*Jbar*w;
3452  jacobian(local_eqn,local_unknown) -=
3453  scaled_re*psif[l2]*base_flow_ur*base_flow_duthetadr
3454  *testf_*Jbar*w;
3455  jacobian(local_eqn,local_unknown) +=
3456  scaled_re_st*psif[l2]*mesh_velocity[0]*base_flow_duthetadr
3457  *testf_*Jbar*w;
3458  jacobian(local_eqn,local_unknown) +=
3459  scaled_re*r*base_flow_uz*group_E[l2]*testf_*w;
3460  jacobian(local_eqn,local_unknown) -=
3461  scaled_re_st*r*mesh_velocity[1]*group_E[l2]*testf_*w;
3462  jacobian(local_eqn,local_unknown) -=
3463  scaled_re*psif[l2]*base_flow_uz*base_flow_duthetadz
3464  *testf_*Jbar*w;
3465  jacobian(local_eqn,local_unknown) +=
3466  scaled_re_st*psif[l2]*mesh_velocity[1]*base_flow_duthetadz
3467  *testf_*Jbar*w;
3468  jacobian(local_eqn,local_unknown) +=
3469  psif[l2]*body_force[2]*testf_*Jbar*w;
3470  jacobian(local_eqn,local_unknown) +=
3471  scaled_re_inv_fr*psif[l2]*G[2]*testf_*Jbar*w;
3472  jacobian(local_eqn,local_unknown) +=
3473  visc_ratio*r*base_flow_duthetadr*group_B[l2]*dtestfdr*w;
3474  jacobian(local_eqn,local_unknown) -=
3475  visc_ratio*psif[l2]*base_flow_duthetadr*dtestfdr*Jbar*w;
3476  jacobian(local_eqn,local_unknown) +=
3477  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadr*psif[l2]
3478  *testf_*Jbar*w/r;
3479  jacobian(local_eqn,local_unknown) +=
3480  visc_ratio*r*base_flow_duthetadz*group_F(l,l2)*w;
3481  jacobian(local_eqn,local_unknown) +=
3482  visc_ratio*r*group_E[l2]*dtestfdz*w;
3483  jacobian(local_eqn,local_unknown) +=
3484  visc_ratio*r*base_flow_duthetadz*group_B[l2]*dtestfdz*w;
3485  jacobian(local_eqn,local_unknown) -=
3486  visc_ratio*psif[l2]*base_flow_duthetadz*dtestfdz*Jbar*w;
3487  jacobian(local_eqn,local_unknown) +=
3488  visc_ratio*base_flow_utheta*psif[l2]*testf_*Jbar*w/(r*r);
3489  jacobian(local_eqn,local_unknown) -=
3490  scaled_re_st*r*base_flow_duthetadt*testf_*group_B[l2]*w;
3491  jacobian(local_eqn,local_unknown) -=
3492  scaled_re*base_flow_utheta*base_flow_ur*testf_*group_B[l2]*w;
3493  jacobian(local_eqn,local_unknown) +=
3494  r*body_force[2]*testf_*group_B[l2]*w;
3495  jacobian(local_eqn,local_unknown) +=
3496  scaled_re_inv_fr*r*G[2]*testf_*group_B[l2]*w;
3497  jacobian(local_eqn,local_unknown) -=
3498  visc_ratio*base_flow_utheta*testf_*group_B[l2]*w/r;
3499  }
3500 
3501  // Perturbation to axial nodal coord (cosine part) Z_k^C
3502  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[2]);
3503  if(local_unknown >= 0)
3504  {
3505  jacobian(local_eqn,local_unknown) -=
3506  k*scaled_re*base_flow_utheta*base_flow_duthetadz*psif[l2]
3507  *testf_*Jbar*w;
3508  jacobian(local_eqn,local_unknown) -=
3509  k*visc_ratio*Gamma[0]*base_flow_durdz*psif[l2]*dtestfdr*Jbar*w;
3510  jacobian(local_eqn,local_unknown) +=
3511  k*base_flow_p*dtestfdz*psif[l2]*Jbar*w;
3512  jacobian(local_eqn,local_unknown) -=
3513  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdz*psif[l2]
3514  *Jbar*w/r;
3515  jacobian(local_eqn,local_unknown) -=
3516  k*visc_ratio*Gamma[0]*base_flow_duzdz*psif[l2]*dtestfdz*Jbar*w;
3517  jacobian(local_eqn,local_unknown) +=
3518  visc_ratio*k*base_flow_durdz*psif[l2]*testf_*Jbar*w/r;
3519  jacobian(local_eqn,local_unknown) +=
3520  k*base_flow_p*testf_*group_A[l2]*w;
3521  jacobian(local_eqn,local_unknown) -=
3522  k*visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_*group_A[l2]*w/r;
3523  }
3524 
3525  // Perturbation to axial nodal coord (sine part) Z_k^S
3526  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[3]);
3527  if(local_unknown >= 0)
3528  {
3529  jacobian(local_eqn,local_unknown) -=
3530  scaled_re*r*base_flow_ur*group_E[l2]*testf_*w;
3531  jacobian(local_eqn,local_unknown) +=
3532  scaled_re_st*r*mesh_velocity[0]*group_E[l2]*testf_*w;
3533  jacobian(local_eqn,local_unknown) +=
3534  scaled_re_st*r*psif[l2]
3536  *base_flow_duthetadz*testf_*Jbar*w;
3537  jacobian(local_eqn,local_unknown) -=
3538  visc_ratio*r*base_flow_duthetadr*group_F(l,l2)*w;
3539  jacobian(local_eqn,local_unknown) -=
3540  visc_ratio*r*group_E[l2]*dtestfdr*w;
3541  jacobian(local_eqn,local_unknown) +=
3542  visc_ratio*r*base_flow_duthetadr*group_A[l2]*dtestfdr*w;
3543  jacobian(local_eqn,local_unknown) +=
3544  visc_ratio*Gamma[0]*base_flow_utheta*group_F(l,l2)*w;
3545  jacobian(local_eqn,local_unknown) +=
3546  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadz*psif[l2]
3547  *testf_*Jbar*w/r;
3548  jacobian(local_eqn,local_unknown) +=
3549  visc_ratio*r*base_flow_duthetadz*group_A[l2]*dtestfdz*w;
3550  jacobian(local_eqn,local_unknown) +=
3551  visc_ratio*Gamma[0]*group_E[l2]*testf_*w;
3552  jacobian(local_eqn,local_unknown) -=
3553  scaled_re_st*r*base_flow_duthetadt*testf_*group_A[l2]*w;
3554  jacobian(local_eqn,local_unknown) -=
3555  scaled_re*base_flow_utheta*base_flow_ur*testf_*group_A[l2]*w;
3556  jacobian(local_eqn,local_unknown) +=
3557  r*body_force[2]*testf_*group_A[l2]*w;
3558  jacobian(local_eqn,local_unknown) +=
3559  scaled_re_inv_fr*r*G[2]*testf_*group_A[l2]*w;
3560  jacobian(local_eqn,local_unknown) -=
3561  visc_ratio*base_flow_utheta*testf_*group_A[l2]*w/r;
3562  }
3563 
3564  } // End of loop over velocity shape functions
3565 
3566  // Now loop over pressure shape functions
3567  // (This is the contribution from pressure gradient)
3568  for(unsigned l2=0;l2<n_pres;l2++)
3569  {
3570  // Cosine part P_k^C
3571  local_unknown = p_local_eqn(l2,0);
3572  if(local_unknown >= 0)
3573  {
3574  jacobian(local_eqn,local_unknown) += k*psip[l2]*testf_*Jbar*w;
3575  }
3576 
3577  // Sine part P_k^S has no contribution
3578 
3579  } // End of loop over pressure shape functions
3580 
3581  // Now loop over the spines in the element
3582  for(unsigned l2=0;l2<n_p;l2++)
3583  {
3584  // Perturbed spine "height" (cosine part) H_k^C
3585  local_unknown =
3587 
3588  if(local_unknown >= 0)
3589  {
3590  for(unsigned a=0;a<3;a++)
3591  {
3592  double sum = 0.0;
3593 
3594  sum -=
3595  k*scaled_re*base_flow_utheta*base_flow_duthetadz
3596  *psif[l2+(3*a)]*testf_*Jbar*w;
3597  sum -=
3598  k*visc_ratio*Gamma[0]*base_flow_durdz*psif[l2+(3*a)]
3599  *dtestfdr*Jbar*w;
3600  sum += k*base_flow_p*dtestfdz*psif[l2+(3*a)]*Jbar*w;
3601  sum -=
3602  visc_ratio*(1.0+Gamma[0])*k*base_flow_ur*dtestfdz
3603  *psif[l2+(3*a)]*Jbar*w/r;
3604  sum -=
3605  k*visc_ratio*Gamma[0]*base_flow_duzdz*psif[l2+(3*a)]
3606  *dtestfdz*Jbar*w;
3607  sum +=
3608  visc_ratio*k*base_flow_durdz*psif[l2+(3*a)]*testf_*Jbar*w/r;
3609  sum += k*base_flow_p*testf_*group_A[l2+(3*a)]*w;
3610  sum -=
3611  k*visc_ratio*(1.0+Gamma[0])*base_flow_ur*testf_
3612  *group_A[l2+(3*a)]*w/r;
3613 
3614  jacobian(local_eqn,local_unknown) +=
3615  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
3616  }
3617  }
3618 
3619  // Perturbed spine "height" (sine part) H_k^S
3620  local_unknown =
3622 
3623  if(local_unknown >= 0)
3624  {
3625  for(unsigned a=0;a<3;a++)
3626  {
3627  double sum = 0.0;
3628 
3629  sum -= scaled_re*r*base_flow_ur*group_E[l2+(3*a)]*testf_*w;
3630  sum +=
3631  scaled_re_st*r*mesh_velocity[0]*group_E[l2+(3*a)]*testf_*w;
3632  sum +=
3633  scaled_re_st*r*psif[l2+(3*a)]
3634  *node_pt(l2+(3*a))->position_time_stepper_pt()->weight(1,0)
3635  *base_flow_duthetadz*testf_*Jbar*w;
3636  sum -=
3637  visc_ratio*r*base_flow_duthetadr*group_F(l,(l2+(3*a)))*w;
3638  sum -= visc_ratio*r*group_E[l2+(3*a)]*dtestfdr*w;
3639  sum +=
3640  visc_ratio*r*base_flow_duthetadr*group_A[l2+(3*a)]
3641  *dtestfdr*w;
3642  sum +=
3643  visc_ratio*Gamma[0]*base_flow_utheta*group_F(l,(l2+(3*a)))*w;
3644  sum +=
3645  visc_ratio*(1.0+Gamma[0])*k*k*base_flow_duthetadz
3646  *psif[l2+(3*a)]*testf_*Jbar*w/r;
3647  sum +=
3648  visc_ratio*r*base_flow_duthetadz*group_A[l2+(3*a)]*dtestfdz*w;
3649  sum += visc_ratio*Gamma[0]*group_E[l2+(3*a)]*testf_*w;
3650  sum -=
3651  scaled_re_st*r*base_flow_duthetadt*testf_*group_A[l2+(3*a)]*w;
3652  sum -=
3653  scaled_re*base_flow_utheta*base_flow_ur*testf_
3654  *group_A[l2+(3*a)]*w;
3655  sum += r*body_force[2]*testf_*group_A[l2+(3*a)]*w;
3656  sum += scaled_re_inv_fr*r*G[2]*testf_*group_A[l2+(3*a)]*w;
3657  sum -=
3658  visc_ratio*base_flow_utheta*testf_*group_A[l2+(3*a)]*w/r;
3659 
3660  jacobian(local_eqn,local_unknown) +=
3661  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
3662  }
3663  }
3664  } // End of loop over spines in the element
3665 
3666  } // End of Jacobian calculation
3667 
3668  } // End of if not boundary condition statement
3669 
3670  } // End of loop over fluid test functions
3671 
3672 
3673  // ====================
3674  // CONTINUITY EQUATIONS
3675  // ====================
3676 
3677  // Loop over the pressure test functions
3678  for(unsigned l=0;l<n_pres;l++)
3679  {
3680  // Cache the test function
3681  const double testp_ = testp[l];
3682 
3683  // --------------------------------------
3684  // FIRST CONTINUITY EQUATION: COSINE PART
3685  // --------------------------------------
3686 
3687  // Get local equation number of first pressure value at this node
3688  local_eqn = p_local_eqn(l,0);
3689 
3690  // If it's not a boundary condition
3691  if(local_eqn >= 0)
3692  {
3693  residuals[local_eqn] += r*interpolated_dUdRC*testp_*Jbar*w;
3694  residuals[local_eqn] += interpolated_RC*base_flow_durdr*testp_*Jbar*w;
3695  residuals[local_eqn] += interpolated_UC*testp_*Jbar*w;
3696  residuals[local_eqn] += k*interpolated_VS*testp_*Jbar*w;
3697  residuals[local_eqn] -=
3698  k*base_flow_duthetadr*interpolated_RS*testp_*Jbar*w;
3699  residuals[local_eqn] -=
3700  k*base_flow_duthetadz*interpolated_ZS*testp_*Jbar*w;
3701  residuals[local_eqn] += r*interpolated_dWdZC*testp_*Jbar*w;
3702  residuals[local_eqn] += interpolated_RC*base_flow_duzdz*testp_*Jbar*w;
3703  residuals[local_eqn] -= interpolated_RC*source*testp_*Jbar*w;
3704  residuals[local_eqn] += base_flow_ur*testp_*JhatC*w;
3705  residuals[local_eqn] -= source*r*testp_*JhatC*w;
3706 
3707 
3708  // Calculate the Jacobian
3709  // ----------------------
3710 
3711  if(flag)
3712  {
3713  // Loop over the velocity shape functions
3714  for(unsigned l2=0;l2<n_node;l2++)
3715  {
3716  // Radial velocity component (cosine part) U_k^C
3717  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
3718  if(local_unknown >= 0)
3719  {
3720  jacobian(local_eqn,local_unknown) += r*group_B[l2]*testp_*w;
3721  jacobian(local_eqn,local_unknown) += psif[l2]*testp_*Jbar*w;
3722  }
3723 
3724  // Radial velocity component (sine part) U_k^S
3725  // has no contribution
3726 
3727  // Axial velocity component (cosine part) W_k^C
3728  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
3729  if(local_unknown >= 0)
3730  {
3731  jacobian(local_eqn,local_unknown) += r*group_A[l2]*testp_*w;
3732  }
3733 
3734  // Axial velocity component (sine part) W_k^S
3735  // has no contribution
3736 
3737  // Azimuthal velocity component (cosine part) V_k^C
3738  // has no contribution
3739 
3740  // Azimuthal velocity component (sine part) V_k^S
3741  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
3742  if(local_unknown >= 0)
3743  {
3744  jacobian(local_eqn,local_unknown) += k*psif[l2]*testp_*Jbar*w;
3745  }
3746 
3747  // Perturbation to radial nodal coord (cosine part) R_k^C
3748  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[0]);
3749  if(local_unknown >= 0)
3750  {
3751  jacobian(local_eqn,local_unknown) +=
3752  psif[l2]*base_flow_durdr*testp_*Jbar*w;
3753  jacobian(local_eqn,local_unknown) -= r*group_D[l2]*testp_*w;
3754  jacobian(local_eqn,local_unknown) +=
3755  psif[l2]*base_flow_duzdz*testp_*Jbar*w;
3756  jacobian(local_eqn,local_unknown) -=
3757  psif[l2]*source*testp_*Jbar*w;
3758  jacobian(local_eqn,local_unknown) +=
3759  base_flow_ur*testp_*group_B[l2]*w;
3760  jacobian(local_eqn,local_unknown) -=
3761  source*r*testp_*group_B[l2]*w;
3762  }
3763 
3764  // Perturbation to radial nodal coord (sine part) R_k^S
3765  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[1]);
3766  if(local_unknown >= 0)
3767  {
3768  jacobian(local_eqn,local_unknown) -=
3769  k*base_flow_duthetadr*psif[l2]*testp_*Jbar*w;
3770  }
3771 
3772  // Perturbation to axial nodal coord (cosine part) Z_k^C
3773  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[2]);
3774  if(local_unknown >= 0)
3775  {
3776  jacobian(local_eqn,local_unknown) += r*group_C[l2]*testp_*w;
3777  jacobian(local_eqn,local_unknown) +=
3778  base_flow_ur*testp_*group_A[l2]*w;
3779  jacobian(local_eqn,local_unknown) -=
3780  source*r*testp_*group_A[l2]*w;
3781  }
3782 
3783  // Perturbation to axial nodal coord (sine part) Z_k^S
3784  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[3]);
3785  if(local_unknown >= 0)
3786  {
3787  jacobian(local_eqn,local_unknown) -=
3788  k*base_flow_duthetadz*psif[l2]*testp_*Jbar*w;
3789  }
3790 
3791  } // End of loop over velocity shape functions
3792 
3793  // Real and imaginary pressure components, P_k^C and P_k^S,
3794  // have no contribution
3795 
3796  // Now loop over the spines in the element
3797  for(unsigned l2=0;l2<n_p;l2++)
3798  {
3799  // Perturbed spine "height" (cosine part) H_k^C
3800  local_unknown =
3802 
3803  if(local_unknown >= 0)
3804  {
3805  for(unsigned a=0;a<3;a++)
3806  {
3807  double sum = 0.0;
3808 
3809  sum += r*group_C[l2+(3*a)]*testp_*w;
3810  sum += base_flow_ur*testp_*group_A[l2+(3*a)]*w;
3811  sum -= source*r*testp_*group_A[l2+(3*a)]*w;
3812 
3813  jacobian(local_eqn,local_unknown) +=
3814  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
3815  }
3816  }
3817 
3818  // Perturbed spine "height" (sine part) H_k^S
3819  local_unknown =
3821 
3822  if(local_unknown >= 0)
3823  {
3824  for(unsigned a=0;a<3;a++)
3825  {
3826  double sum = 0.0;
3827 
3828  sum -= k*base_flow_duthetadz*psif[l2+(3*a)]*testp_*Jbar*w;
3829 
3830  jacobian(local_eqn,local_unknown) +=
3831  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
3832  }
3833  }
3834  } // End of loop over spines in the element
3835 
3836  } // End of Jacobian calculation
3837 
3838  } // End of if not boundary condition statement
3839 
3840  // -------------------------------------
3841  // SECOND CONTINUITY EQUATION: SINE PART
3842  // -------------------------------------
3843 
3844  // Get local equation number of second pressure value at this node
3845  local_eqn = p_local_eqn(l,1);
3846 
3847  // If it's not a boundary condition
3848  if(local_eqn >= 0)
3849  {
3850  residuals[local_eqn] += r*interpolated_dUdRS*testp_*Jbar*w;
3851  residuals[local_eqn] += interpolated_RS*base_flow_durdr*testp_*Jbar*w;
3852  residuals[local_eqn] += interpolated_US*testp_*Jbar*w;
3853  residuals[local_eqn] -= k*interpolated_VC*testp_*Jbar*w;
3854  residuals[local_eqn] +=
3855  k*base_flow_duthetadr*interpolated_RC*testp_*Jbar*w;
3856  residuals[local_eqn] +=
3857  k*base_flow_duthetadz*interpolated_ZC*testp_*Jbar*w;
3858  residuals[local_eqn] += r*interpolated_dWdZS*testp_*Jbar*w;
3859  residuals[local_eqn] += interpolated_RS*base_flow_duzdz*testp_*Jbar*w;
3860  residuals[local_eqn] -= interpolated_RS*source*testp_*Jbar*w;
3861  residuals[local_eqn] += base_flow_ur*testp_*JhatS*w;
3862  residuals[local_eqn] -= source*r*testp_*JhatS*w;
3863 
3864 
3865  // Calculate the Jacobian
3866  // ----------------------
3867 
3868  if(flag)
3869  {
3870  // Loop over the velocity shape functions
3871  for(unsigned l2=0;l2<n_node;l2++)
3872  {
3873  // Radial velocity component (cosine part) U_k^C
3874  // has no contribution
3875 
3876  // Radial velocity component (sine part) U_k^S
3877  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
3878  if(local_unknown >= 0)
3879  {
3880  jacobian(local_eqn,local_unknown) += r*group_B[l2]*testp_*w;
3881  jacobian(local_eqn,local_unknown) += psif[l2]*testp_*Jbar*w;
3882  }
3883 
3884  // Axial velocity component (cosine part) W_k^C
3885  // has no contribution
3886 
3887  // Axial velocity component (sine part) W_k^S
3888  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
3889  if(local_unknown >= 0)
3890  {
3891  jacobian(local_eqn,local_unknown) += r*group_A[l2]*testp_*w;
3892  }
3893 
3894  // Azimuthal velocity component (cosine part) V_k^C
3895  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
3896  if(local_unknown >= 0)
3897  {
3898  jacobian(local_eqn,local_unknown) -= k*psif[l2]*testp_*Jbar*w;
3899  }
3900 
3901  // Azimuthal velocity component (sine part) V_k^S
3902  // has no contribution
3903 
3904  // Perturbation to radial nodal coord (cosine part) R_k^C
3905  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[0]);
3906  if(local_unknown >= 0)
3907  {
3908  jacobian(local_eqn,local_unknown) +=
3909  k*base_flow_duthetadr*psif[l2]*testp_*Jbar*w;
3910  }
3911 
3912  // Perturbation to radial nodal coord (sine part) R_k^S
3913  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[1]);
3914  if(local_unknown >= 0)
3915  {
3916  jacobian(local_eqn,local_unknown) +=
3917  psif[l2]*base_flow_durdr*testp_*Jbar*w;
3918  jacobian(local_eqn,local_unknown) -=
3919  r*group_D[l2]*testp_*w;
3920  jacobian(local_eqn,local_unknown) +=
3921  psif[l2]*base_flow_duzdz*testp_*Jbar*w;
3922  jacobian(local_eqn,local_unknown) -=
3923  psif[l2]*source*testp_*Jbar*w;
3924  jacobian(local_eqn,local_unknown) +=
3925  base_flow_ur*testp_*group_B[l2]*w;
3926  jacobian(local_eqn,local_unknown) -=
3927  source*r*testp_*group_B[l2]*w;
3928  }
3929 
3930  // Perturbation to axial nodal coord (cosine part) Z_k^C
3931  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[2]);
3932  if(local_unknown >= 0)
3933  {
3934  jacobian(local_eqn,local_unknown) +=
3935  k*base_flow_duthetadz*psif[l2]*testp_*Jbar*w;
3936  }
3937 
3938  // Perturbation to axial nodal coord (sine part) Z_k^S
3939  local_unknown = nodal_local_eqn(l2,xhat_nodal_index[3]);
3940  if(local_unknown >= 0)
3941  {
3942  jacobian(local_eqn,local_unknown) += r*group_C[l2]*testp_*w;
3943  jacobian(local_eqn,local_unknown) +=
3944  base_flow_ur*testp_*group_A[l2]*w;
3945  jacobian(local_eqn,local_unknown) -=
3946  source*r*testp_*group_A[l2]*w;
3947  }
3948 
3949  } // End of loop over velocity shape functions
3950 
3951  // Real and imaginary pressure components, P_k^C and P_k^S,
3952  // have no contribution
3953 
3954  // Now loop over the spines in the element
3955  for(unsigned l2=0;l2<n_p;l2++)
3956  {
3957  // Perturbed spine "height" (cosine part) H_k^C
3958  local_unknown =
3960 
3961  if(local_unknown >= 0)
3962  {
3963  for(unsigned a=0;a<3;a++)
3964  {
3965  double sum = 0.0;
3966 
3967  sum += k*base_flow_duthetadz*psif[l2+(3*a)]*testp_*Jbar*w;
3968 
3969  jacobian(local_eqn,local_unknown) +=
3970  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
3971  }
3972  }
3973 
3974  // Perturbed spine "height" (sine part) H_k^S
3975  local_unknown =
3977 
3978  if(local_unknown >= 0)
3979  {
3980  for(unsigned a=0;a<3;a++)
3981  {
3982  double sum = 0.0;
3983 
3984  sum += r*group_C[l2+(3*a)]*testp_*w;
3985  sum += base_flow_ur*testp_*group_A[l2+(3*a)]*w;
3986  sum -= source*r*testp_*group_A[l2+(3*a)]*w;
3987 
3988  jacobian(local_eqn,local_unknown) +=
3989  sum*effective_perturbed_spine_node_fraction[l2+(3*a)];
3990  }
3991  }
3992  } // End of loop over spines in the element
3993 
3994  } // End of Jacobian calculation
3995 
3996  } // End of if not boundary condition statement
3997 
3998  } // End of loop over pressure test functions
3999 
4000  } // End of loop over the integration points
4001 
4002  } // End of fill_in_generic_residual_contribution_lin_axi_nst
JacobiRotation< float > G
Definition: Jacobi_makeGivens.cpp:2
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
double raw_dnodal_position_dt(const unsigned &n, const unsigned &i) const
Definition: elements.h:2256
virtual unsigned nnode_1d() const
Definition: elements.h:2218
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 p_lin_axi_nst(const unsigned &n_p, const unsigned &i) const =0
virtual void get_base_flow_duds(const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:398
const double & viscosity_ratio() const
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:245
double get_source_base_flow(const double &time, const unsigned &ipt, const Vector< double > &x)
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:334
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:226
virtual void get_base_flow_p(const double &time, const unsigned &ipt, const Vector< double > &x, double &result) const
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:264
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:217
const double & re() const
Reynolds number.
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:223
virtual void get_base_flow_u(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:143
virtual int p_local_eqn(const unsigned &n, const unsigned &i)=0
double dnodal_position_perturbation_dt_lin_axi_nst(const unsigned &n, const unsigned &i) const
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:654
virtual void pshape_lin_axi_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
virtual void get_base_flow_dudx(const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:164
const double & density_ratio() const
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:252
void get_body_force_base_flow(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result)
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:314
const int & azimuthal_mode_number() const
Azimuthal mode number k in e^ik(theta) decomposition.
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:229
virtual double dshape_and_dtest_eulerian_at_knot_lin_axi_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
virtual void get_base_flow_dudt(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:244
const Vector< double > & g() const
Vector of gravitational components.
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:496
virtual int get_local_eqn_number_corresponding_to_geometric_dofs(const unsigned &n, const unsigned &i)=0
const double & re_invfr() const
Global inverse Froude number.
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:484
double & time()
Return current value of continous time.
Definition: timesteppers.h:332
const Scalar * a
Definition: level2_cplx_impl.h:32
char char char int int * k
Definition: level2_impl.h:374
void body_force(const double &time, const Vector< double > &x, Vector< double > &result)
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:96
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46
r
Definition: UniformPSDSelfTest.py:20
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61

References a, ALE_is_disabled, azimuthal_mode_number(), Global_Parameters::body_force(), density_ratio(), dnodal_position_perturbation_dt_lin_axi_nst(), dshape_and_dtest_eulerian_at_knot_lin_axi_nst(), oomph::FiniteElement::dshape_local_at_knot(), du_dt_lin_axi_nst(), oomph::PerturbedSpineNode::fraction(), G, g(), Gamma, get_base_flow_duds(), get_base_flow_dudt(), get_base_flow_dudx(), get_base_flow_p(), get_base_flow_u(), get_body_force_base_flow(), get_local_eqn_number_corresponding_to_geometric_dofs(), get_source_base_flow(), i, oomph::FiniteElement::integral_pt(), oomph::FiniteElement::interpolated_x(), j, k, oomph::Integral::knot(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nnode_1d(), oomph::FiniteElement::nodal_local_eqn(), oomph::FiniteElement::node_pt(), oomph::PerturbedSpineNode::node_update_fct_id(), npres_lin_axi_nst(), oomph::Integral::nweight(), OOMPH_EXCEPTION_LOCATION, p_lin_axi_nst(), p_local_eqn(), oomph::Node::position_time_stepper_pt(), pshape_lin_axi_nst(), UniformPSDSelfTest::r, oomph::FiniteElement::raw_dnodal_position_dt(), oomph::FiniteElement::raw_nodal_position(), oomph::FiniteElement::raw_nodal_value(), re(), re_invfr(), re_st(), s, TestProblem::source(), oomph::TimeStepper::time(), oomph::Data::time_stepper_pt(), u_index_lin_axi_nst(), viscosity_ratio(), w, oomph::Integral::weight(), oomph::TimeStepper::weight(), and xhat_index_lin_axi_nst().

Referenced by fill_in_contribution_to_jacobian(), fill_in_contribution_to_jacobian_and_mass_matrix(), and fill_in_contribution_to_residuals().

◆ fill_in_generic_residual_contribution_linearised_axi_nst() [1/2]

void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_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 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::RefineableLinearisedAxisymmetricNavierStokesEquations, and oomph::RefineableLinearisedAxisymmetricNavierStokesEquations.

472  {
473  // Determine number of nodes in the element
474  const unsigned n_node = nnode();
475 
476  // Get continuous time from timestepper of first node
477  double time=node_pt(0)->time_stepper_pt()->time_pt()->time();
478 
479  // Determine how many pressure values there are associated with
480  // a single pressure component
481  const unsigned n_pres = npres_linearised_axi_nst();
482 
483  // Get the nodal indices at which the velocity is stored
484  unsigned u_nodal_index[6];
485  for(unsigned i=0;i<6;++i)
486  {
487  u_nodal_index[i] = u_index_linearised_axi_nst(i);
488  }
489 
490  // Set up memory for the fluid shape and test functions
491  // Note that there are two dimensions, r and z, in this problem
492  Shape psif(n_node), testf(n_node);
493  DShape dpsifdx(n_node,2), dtestfdx(n_node,2);
494 
495  // Set up memory for the pressure shape and test functions
496  Shape psip(n_pres), testp(n_pres);
497 
498  // Determine number of integration points
499  const unsigned n_intpt = integral_pt()->nweight();
500 
501  // Set up memory for the vector to hold local coordinates (two dimensions)
502  Vector<double> s(2);
503 
504  // Get physical variables from the element
505  // (Reynolds number must be multiplied by the density ratio)
506  const double scaled_re = re()*density_ratio();
507  const double scaled_re_st = re_st()*density_ratio();
508  const double visc_ratio = viscosity_ratio();
509  const int k = azimuthal_mode_number();
510 
511  // Integers used to store the local equation and unknown numbers
512  int local_eqn = 0, local_unknown = 0;
513 
514  // Loop over the integration points
515  for(unsigned ipt=0;ipt<n_intpt;ipt++)
516  {
517  // Assign values of the local coordinates s
518  for(unsigned i=0;i<2;i++) { s[i] = integral_pt()->knot(ipt,i); }
519 
520  // Get the integral weight
521  const double w = integral_pt()->weight(ipt);
522 
523  // Calculate the fluid shape and test functions, and their derivatives
524  // w.r.t. the global coordinates
525  const double J =
527  testf,dtestfdx);
528 
529  // Calculate the pressure shape and test functions
530  pshape_linearised_axi_nst(s,psip,testp);
531 
532  // Premultiply the weights and the Jacobian of the mapping between
533  // local and global coordinates
534  const double W = w*J;
535 
536  // Allocate storage for the position and the derivative of the
537  // mesh positions w.r.t. time
538  Vector<double> interpolated_x(2,0.0);
539  Vector<double> mesh_velocity(2,0.0);
540 
541  // Allocate storage for the velocity components (six of these)
542  // and their derivatives w.r.t. time
543  Vector<double> interpolated_u(6,0.0);
544  Vector<double> dudt(6,0.0);
545 
546  // Allocate storage for the pressure components (two of these)
547  Vector<double> interpolated_p(2,0.0);
548 
549  // Allocate storage for the derivatives of the velocity components
550  // w.r.t. global coordinates (r and z)
551  DenseMatrix<double> interpolated_dudx(6,2,0.0);
552 
553  // Calculate pressure at the integration point
554  // -------------------------------------------
555 
556  // Loop over pressure degrees of freedom (associated with a single
557  // pressure component) in the element
558  for(unsigned l=0;l<n_pres;l++)
559  {
560  // Cache the shape function
561  const double psip_ = psip(l);
562 
563  // Loop over the two pressure components
564  for(unsigned i=0;i<2;i++)
565  {
566  // Get the value
567  const double p_value = this->p_linearised_axi_nst(l,i);
568 
569  // Add contribution
570  interpolated_p[i] += p_value*psip_;
571  }
572  } // End of loop over the pressure degrees of freedom in the element
573 
574  // Calculate velocities and their derivatives at the integration point
575  // -------------------------------------------------------------------
576 
577  // Loop over the element's nodes
578  for(unsigned l=0;l<n_node;l++)
579  {
580  // Cache the shape function
581  const double psif_ = psif(l);
582 
583  // Loop over the two coordinate directions
584  for(unsigned i=0;i<2;i++)
585  {
586  interpolated_x[i] += this->raw_nodal_position(l,i)*psif_;
587  }
588 
589  // Loop over the six velocity components
590  for(unsigned i=0;i<6;i++)
591  {
592  // Get the value
593  const double u_value = this->raw_nodal_value(l,u_nodal_index[i]);
594 
595  // Add contribution
596  interpolated_u[i] += u_value*psif_;
597 
598  // Add contribution to dudt
599  dudt[i] += du_dt_linearised_axi_nst(l,i)*psif_;
600 
601  // Loop over two coordinate directions (for derivatives)
602  for(unsigned j=0;j<2;j++)
603  {
604  interpolated_dudx(i,j) += u_value*dpsifdx(l,j);
605  }
606  }
607  } // End of loop over the element's nodes
608 
609  // Get the mesh velocity if ALE is enabled
610  if(!ALE_is_disabled)
611  {
612  // Loop over the element's nodes
613  for(unsigned l=0;l<n_node;l++)
614  {
615  // Loop over the two coordinate directions
616  for(unsigned i=0;i<2;i++)
617  {
618  mesh_velocity[i] += this->raw_dnodal_position_dt(l,i)*psif(l);
619  }
620  }
621  }
622 
623  // Get velocities and their derivatives from base flow problem
624  // -----------------------------------------------------------
625 
626  // Allocate storage for the velocity components of the base state
627  // solution (initialise to zero)
628  Vector<double> base_flow_u(3,0.0);
629 
630  // Get the user-defined base state solution velocity components
631  get_base_flow_u(time,ipt,interpolated_x,base_flow_u);
632 
633  // Allocate storage for the derivatives of the base state solution's
634  // velocity components w.r.t. global coordinate (r and z)
635  // N.B. the derivatives of the base flow components w.r.t. the
636  // azimuthal coordinate direction (theta) are always zero since the
637  // base flow is axisymmetric
638  DenseMatrix<double> base_flow_dudx(3,2,0.0);
639 
640  // Get the derivatives of the user-defined base state solution
641  // velocity components w.r.t. global coordinates
642  get_base_flow_dudx(time,ipt,interpolated_x,base_flow_dudx);
643 
644  // Cache base flow velocities and their derivatives
645  const double interpolated_ur = base_flow_u[0];
646  const double interpolated_uz = base_flow_u[1];
647  const double interpolated_utheta = base_flow_u[2];
648  const double interpolated_durdr = base_flow_dudx(0,0);
649  const double interpolated_durdz = base_flow_dudx(0,1);
650  const double interpolated_duzdr = base_flow_dudx(1,0);
651  const double interpolated_duzdz = base_flow_dudx(1,1);
652  const double interpolated_duthetadr = base_flow_dudx(2,0);
653  const double interpolated_duthetadz = base_flow_dudx(2,1);
654 
655  // Cache r-component of position
656  const double r = interpolated_x[0];
657 
658  // Cache unknowns
659  const double interpolated_UC = interpolated_u[0];
660  const double interpolated_US = interpolated_u[1];
661  const double interpolated_WC = interpolated_u[2];
662  const double interpolated_WS = interpolated_u[3];
663  const double interpolated_VC = interpolated_u[4];
664  const double interpolated_VS = interpolated_u[5];
665  const double interpolated_PC = interpolated_p[0];
666  const double interpolated_PS = interpolated_p[1];
667 
668  // Cache derivatives of the unknowns
669  const double interpolated_dUCdr = interpolated_dudx(0,0);
670  const double interpolated_dUCdz = interpolated_dudx(0,1);
671  const double interpolated_dUSdr = interpolated_dudx(1,0);
672  const double interpolated_dUSdz = interpolated_dudx(1,1);
673  const double interpolated_dWCdr = interpolated_dudx(2,0);
674  const double interpolated_dWCdz = interpolated_dudx(2,1);
675  const double interpolated_dWSdr = interpolated_dudx(3,0);
676  const double interpolated_dWSdz = interpolated_dudx(3,1);
677  const double interpolated_dVCdr = interpolated_dudx(4,0);
678  const double interpolated_dVCdz = interpolated_dudx(4,1);
679  const double interpolated_dVSdr = interpolated_dudx(5,0);
680  const double interpolated_dVSdz = interpolated_dudx(5,1);
681 
682  // ==================
683  // MOMENTUM EQUATIONS
684  // ==================
685 
686  // Loop over the test functions
687  for(unsigned l=0;l<n_node;l++)
688  {
689  // Cache test functions and their derivatives
690  const double testf_ = testf(l);
691  const double dtestfdr = dtestfdx(l,0);
692  const double dtestfdz = dtestfdx(l,1);
693 
694  // ---------------------------------------------
695  // FIRST (RADIAL) MOMENTUM EQUATION: COSINE PART
696  // ---------------------------------------------
697 
698  // Get local equation number of first velocity value at this node
699  local_eqn = nodal_local_eqn(l,u_nodal_index[0]);
700 
701  // If it's not a boundary condition
702  if(local_eqn >= 0)
703  {
704  // Pressure gradient term
705  residuals[local_eqn] += interpolated_PC*(testf_ + r*dtestfdr)*W;
706 
707  // Stress tensor terms
708  residuals[local_eqn] -= visc_ratio*
709  r*(1.0+Gamma[0])*interpolated_dUCdr*dtestfdr*W;
710 
711  residuals[local_eqn] -= visc_ratio*r*
712  (interpolated_dUCdz + Gamma[0]*interpolated_dWCdr)*
713  dtestfdz*W;
714 
715  residuals[local_eqn] += visc_ratio*(
716  (k*Gamma[0]*interpolated_dVSdr)
717  - (k*(2.0+Gamma[0])*interpolated_VS/r)
718  - ((1.0+Gamma[0]+(k*k))*interpolated_UC/r))*testf_*W;
719 
720  // Inertial terms (du/dt)
721  residuals[local_eqn] -= scaled_re_st*r*dudt[0]*testf_*W;
722 
723  // Inertial terms (convective)
724  residuals[local_eqn] -=
725  scaled_re*(r*interpolated_ur*interpolated_dUCdr
726  + r*interpolated_durdr*interpolated_UC
727  + k*interpolated_utheta*interpolated_US
728  - 2*interpolated_utheta*interpolated_VC
729  + r*interpolated_uz*interpolated_dUCdz
730  + r*interpolated_durdz*interpolated_WC)*testf_*W;
731 
732  // Mesh velocity terms
733  if(!ALE_is_disabled)
734  {
735  for(unsigned j=0;j<2;j++)
736  {
737  residuals[local_eqn] +=
738  scaled_re_st*r*mesh_velocity[j]
739  *interpolated_dudx(0,j)*testf_*W;
740  }
741  }
742 
743  // Calculate the Jacobian
744  // ----------------------
745 
746  if(flag)
747  {
748  // Loop over the velocity shape functions again
749  for(unsigned l2=0;l2<n_node;l2++)
750  {
751  // Cache velocity shape functions and their derivatives
752  const double psif_ = psif[l2];
753  const double dpsifdr = dpsifdx(l2,0);
754  const double dpsifdz = dpsifdx(l2,1);
755 
756  // Radial velocity component (cosine part) U_k^C
757  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
758  if(local_unknown >= 0)
759  {
760  if(flag==2)
761  {
762  // Add the mass matrix
763  mass_matrix(local_eqn,local_unknown) +=
764  scaled_re_st*r*psif_*testf_*W;
765  }
766 
767  // Add contributions to the Jacobian matrix
768 
769  // Stress tensor terms
770  jacobian(local_eqn,local_unknown)
771  -= visc_ratio*r*(1.0+Gamma[0])*dpsifdr*dtestfdr*W;
772 
773  jacobian(local_eqn,local_unknown)
774  -= visc_ratio*r*dpsifdz*dtestfdz*W;
775 
776  jacobian(local_eqn,local_unknown)
777  -= visc_ratio*(1.0+Gamma[0]+(k*k))*psif_*testf_*W/r;
778 
779  // Inertial terms (du/dt)
780  jacobian(local_eqn,local_unknown) -=
781  scaled_re_st*r*node_pt(l2)->time_stepper_pt()->weight(1,0)*
782  psif_*testf_*W;
783 
784  // Inertial terms (convective)
785  jacobian(local_eqn,local_unknown) -=
786  scaled_re*r*(psif_*interpolated_durdr
787  + interpolated_ur*dpsifdr
788  + interpolated_uz*dpsifdz)*testf_*W;
789 
790  // Mesh velocity terms
791  if(!ALE_is_disabled)
792  {
793  for(unsigned j=0;j<2;j++)
794  {
795  jacobian(local_eqn,local_unknown) +=
796  scaled_re_st*r*mesh_velocity[j]
797  *dpsifdx(l2,j)*testf_*W;
798  }
799  }
800  }
801 
802  // Radial velocity component (sine part) U_k^S
803  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
804  if(local_unknown >= 0)
805  {
806  // Convective term
807  jacobian(local_eqn,local_unknown) -=
808  scaled_re*k*interpolated_utheta*psif_*testf_*W;
809  }
810 
811  // Axial velocity component (cosine part) W_k^C
812  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
813  if(local_unknown >= 0)
814  {
815  // Stress tensor term
816  jacobian(local_eqn,local_unknown) -=
817  visc_ratio*Gamma[0]*r*dpsifdr*dtestfdz*W;
818 
819  // Convective term
820  jacobian(local_eqn,local_unknown) -=
821  scaled_re*r*interpolated_durdz*psif_*testf_*W;
822  }
823 
824  // Axial velocity component (sine part) W_k^S
825  // has no contribution
826 
827  // Azimuthal velocity component (cosine part) V_k^C
828  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
829  if(local_unknown >= 0)
830  {
831  // Convective term
832  jacobian(local_eqn,local_unknown) +=
833  scaled_re*2*interpolated_utheta*psif_*testf_*W;
834  }
835 
836  // Azimuthal velocity component (sine part) V_k^S
837  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
838  if(local_unknown >= 0)
839  {
840  // Stress tensor term
841  jacobian(local_eqn,local_unknown) += visc_ratio*(
842  (Gamma[0]*k*dpsifdr) - (k*(2.0+Gamma[0])*psif_/r))*testf_*W;
843  }
844  } // End of loop over velocity shape functions
845 
846  // Now loop over pressure shape functions
847  // (This is the contribution from pressure gradient)
848  for(unsigned l2=0;l2<n_pres;l2++)
849  {
850  // Cosine part P_k^C
851  local_unknown = p_local_eqn(l2,0);
852  if(local_unknown >= 0)
853  {
854  jacobian(local_eqn,local_unknown) +=
855  psip[l2]*(testf_ + r*dtestfdr)*W;
856  }
857 
858  // Sine part P_k^S has no contribution
859 
860  } // End of loop over pressure shape functions
861  } // End of Jacobian calculation
862 
863  } // End of if not boundary condition statement
864 
865  // --------------------------------------------
866  // SECOND (RADIAL) MOMENTUM EQUATION: SINE PART
867  // --------------------------------------------
868 
869  // Get local equation number of second velocity value at this node
870  local_eqn = nodal_local_eqn(l,u_nodal_index[1]);
871 
872  // If it's not a boundary condition
873  if(local_eqn >= 0)
874  {
875  // Pressure gradient term
876  residuals[local_eqn] += interpolated_PS*(testf_ + r*dtestfdr)*W;
877 
878  // Stress tensor terms
879  residuals[local_eqn] -= visc_ratio*
880  r*(1.0+Gamma[0])*interpolated_dUSdr*dtestfdr*W;
881 
882  residuals[local_eqn] -= visc_ratio*r*
883  (interpolated_dUSdz + Gamma[0]*interpolated_dWSdr)*
884  dtestfdz*W;
885 
886  residuals[local_eqn] -= visc_ratio*(
887  (k*Gamma[0]*interpolated_dVCdr)
888  - (k*(2.0+Gamma[0])*interpolated_VC/r)
889  + ((1.0+Gamma[0]+(k*k))*interpolated_US/r))*testf_*W;
890 
891  // Inertial terms (du/dt)
892  residuals[local_eqn] -= scaled_re_st*r*dudt[1]*testf_*W;
893 
894  // Inertial terms (convective)
895  residuals[local_eqn] -=
896  scaled_re*(r*interpolated_ur*interpolated_dUSdr
897  + r*interpolated_durdr*interpolated_US
898  - k*interpolated_utheta*interpolated_UC
899  - 2*interpolated_utheta*interpolated_VS
900  + r*interpolated_uz*interpolated_dUSdz
901  + r*interpolated_durdz*interpolated_WS)*testf_*W;
902 
903  // Mesh velocity terms
904  if(!ALE_is_disabled)
905  {
906  for(unsigned j=0;j<2;j++)
907  {
908  residuals[local_eqn] +=
909  scaled_re_st*r*mesh_velocity[j]
910  *interpolated_dudx(1,j)*testf_*W;
911  }
912  }
913 
914  // Calculate the Jacobian
915  // ----------------------
916 
917  if(flag)
918  {
919  // Loop over the velocity shape functions again
920  for(unsigned l2=0;l2<n_node;l2++)
921  {
922  // Cache velocity shape functions and their derivatives
923  const double psif_ = psif[l2];
924  const double dpsifdr = dpsifdx(l2,0);
925  const double dpsifdz = dpsifdx(l2,1);
926 
927  // Radial velocity component (cosine part) U_k^C
928  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
929  if(local_unknown >= 0)
930  {
931  // Convective term
932  jacobian(local_eqn,local_unknown) +=
933  scaled_re*k*interpolated_utheta*psif_*testf_*W;
934  }
935 
936  // Radial velocity component (sine part) U_k^S
937  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
938  if(local_unknown >= 0)
939  {
940  if(flag==2)
941  {
942  // Add the mass matrix
943  mass_matrix(local_eqn,local_unknown) +=
944  scaled_re_st*r*psif_*testf_*W;
945  }
946 
947  // Add contributions to the Jacobian matrix
948 
949  // Stress tensor terms
950  jacobian(local_eqn,local_unknown)
951  -= visc_ratio*r*(1.0+Gamma[0])*dpsifdr*dtestfdr*W;
952 
953  jacobian(local_eqn,local_unknown)
954  -= visc_ratio*r*dpsifdz*dtestfdz*W;
955 
956  jacobian(local_eqn,local_unknown)
957  -= visc_ratio*(1.0+Gamma[0]+(k*k))*psif_*testf_*W/r;
958 
959  // Inertial terms (du/dt)
960  jacobian(local_eqn,local_unknown)
961  -= scaled_re_st*r*node_pt(l2)->time_stepper_pt()->weight(1,0)*
962  psif_*testf_*W;
963 
964  // Inertial terms (convective)
965  jacobian(local_eqn,local_unknown) -=
966  scaled_re*r*(psif_*interpolated_durdr
967  + interpolated_ur*dpsifdr
968  + interpolated_uz*dpsifdz)*testf_*W;
969 
970  // Mesh velocity terms
971  if(!ALE_is_disabled)
972  {
973  for(unsigned j=0;j<2;j++)
974  {
975  jacobian(local_eqn,local_unknown) +=
976  scaled_re_st*r*mesh_velocity[j]
977  *dpsifdx(l2,j)*testf_*W;
978  }
979  }
980  }
981 
982  // Axial velocity component (cosine part) W_k^C
983  // has no contribution
984 
985  // Axial velocity component (sine part) W_k^S
986  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
987  if(local_unknown >= 0)
988  {
989  // Stress tensor term
990  jacobian(local_eqn,local_unknown) -=
991  visc_ratio*Gamma[0]*r*dpsifdr*dtestfdz*W;
992 
993  // Convective term
994  jacobian(local_eqn,local_unknown) -=
995  scaled_re*r*interpolated_durdz*psif_*testf_*W;
996  }
997 
998  // Azimuthal velocity component (cosine part) V_k^C
999  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
1000  if(local_unknown >= 0)
1001  {
1002  // Stress tensor terms
1003  jacobian(local_eqn,local_unknown) -= visc_ratio*(
1004  (Gamma[0]*k*dpsifdr)
1005  - (k*(2.0+Gamma[0])*psif_/r))*testf_*W;
1006  }
1007 
1008  // Azimuthal velocity component (sine part) V_k^S
1009  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
1010  if(local_unknown >= 0)
1011  {
1012  // Convective term
1013  jacobian(local_eqn,local_unknown) +=
1014  scaled_re*2*interpolated_utheta*psif_*testf_*W;
1015  }
1016  } // End of loop over velocity shape functions
1017 
1018  // Now loop over pressure shape functions
1019  // (This is the contribution from pressure gradient)
1020  for(unsigned l2=0;l2<n_pres;l2++)
1021  {
1022  // Cosine part P_k^C has no contribution
1023 
1024  // Sine part P_k^S
1025  local_unknown = p_local_eqn(l2,1);
1026  if(local_unknown >= 0)
1027  {
1028  jacobian(local_eqn,local_unknown)
1029  += psip[l2]*(testf_ + r*dtestfdr)*W;
1030  }
1031  } // End of loop over pressure shape functions
1032  } // End of Jacobian calculation
1033 
1034  } // End of if not boundary condition statement
1035 
1036  // --------------------------------------------
1037  // THIRD (AXIAL) MOMENTUM EQUATION: COSINE PART
1038  // --------------------------------------------
1039 
1040  // Get local equation number of third velocity value at this node
1041  local_eqn = nodal_local_eqn(l,u_nodal_index[2]);
1042 
1043  // If it's not a boundary condition
1044  if(local_eqn >= 0)
1045  {
1046  // Pressure gradient term
1047  residuals[local_eqn] += r*interpolated_PC*dtestfdz*W;
1048 
1049  // Stress tensor terms
1050  residuals[local_eqn] -= visc_ratio*r*
1051  (interpolated_dWCdr + Gamma[1]*interpolated_dUCdz)
1052  *dtestfdr*W;
1053 
1054  residuals[local_eqn] -= visc_ratio*r*
1055  (1.0 + Gamma[1])*interpolated_dWCdz*dtestfdz*W;
1056 
1057  residuals[local_eqn] += visc_ratio*k*
1058  (Gamma[1]*interpolated_dVSdz - k*interpolated_WC/r)*testf_*W;
1059 
1060  // Inertial terms (du/dt)
1061  residuals[local_eqn] -= scaled_re_st*r*dudt[2]*testf_*W;
1062 
1063  // Inertial terms (convective)
1064  residuals[local_eqn] -=
1065  scaled_re*(r*interpolated_ur*interpolated_dWCdr
1066  + r*interpolated_duzdr*interpolated_UC
1067  + k*interpolated_utheta*interpolated_WS
1068  + r*interpolated_uz*interpolated_dWCdz
1069  + r*interpolated_duzdz*interpolated_WC)*testf_*W;
1070 
1071  // Mesh velocity terms
1072  if(!ALE_is_disabled)
1073  {
1074  for(unsigned j=0;j<2;j++)
1075  {
1076  residuals[local_eqn] +=
1077  scaled_re_st*r*mesh_velocity[j]
1078  *interpolated_dudx(2,j)*testf_*W;
1079  }
1080  }
1081 
1082  // Calculate the Jacobian
1083  // ----------------------
1084 
1085  if(flag)
1086  {
1087  // Loop over the velocity shape functions again
1088  for(unsigned l2=0;l2<n_node;l2++)
1089  {
1090  // Cache velocity shape functions and their derivatives
1091  const double psif_ = psif[l2];
1092  const double dpsifdr = dpsifdx(l2,0);
1093  const double dpsifdz = dpsifdx(l2,1);
1094 
1095  // Radial velocity component (cosine part) U_k^C
1096  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
1097  if(local_unknown >= 0)
1098  {
1099  // Stress tensor term
1100  jacobian(local_eqn,local_unknown) -=
1101  visc_ratio*r*Gamma[1]*dpsifdz*dtestfdr*W;
1102 
1103  // Convective term
1104  jacobian(local_eqn,local_unknown) -=
1105  scaled_re*r*psif_*interpolated_duzdr*testf_*W;
1106  }
1107 
1108  // Radial velocity component (sine part) U_k^S
1109  // has no contribution
1110 
1111  // Axial velocity component (cosine part) W_k^C
1112  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
1113  if(local_unknown >= 0)
1114  {
1115  if(flag==2)
1116  {
1117  // Add the mass matrix
1118  mass_matrix(local_eqn,local_unknown) +=
1119  scaled_re_st*r*psif_*testf_*W;
1120  }
1121 
1122  // Add contributions to the Jacobian matrix
1123 
1124  // Stress tensor terms
1125  jacobian(local_eqn,local_unknown) -=
1126  visc_ratio*r*dpsifdr*dtestfdr*W;
1127 
1128  jacobian(local_eqn,local_unknown) -=
1129  visc_ratio*r*(1.0+Gamma[1])*dpsifdz*dtestfdz*W;
1130 
1131  jacobian(local_eqn,local_unknown) -=
1132  visc_ratio*k*k*psif_*testf_*W/r;
1133 
1134  // Inertial terms (du/dt)
1135  jacobian(local_eqn,local_unknown) -=
1136  scaled_re_st*r*node_pt(l2)->time_stepper_pt()->weight(1,0)*
1137  psif_*testf_*W;
1138 
1139  // Inertial terms (convective)
1140  jacobian(local_eqn,local_unknown) -=
1141  scaled_re*r*(interpolated_ur*dpsifdr
1142  + psif_*interpolated_duzdz
1143  + interpolated_uz*dpsifdz)*testf_*W;
1144 
1145 
1146  // Mesh velocity terms
1147  if(!ALE_is_disabled)
1148  {
1149  for(unsigned j=0;j<2;j++)
1150  {
1151  jacobian(local_eqn,local_unknown) +=
1152  scaled_re_st*r*mesh_velocity[j]
1153  *dpsifdx(l2,j)*testf_*W;
1154  }
1155  }
1156  }
1157 
1158  // Axial velocity component (sine part) W_k^S
1159  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
1160  if(local_unknown >= 0)
1161  {
1162  // Convective term
1163  jacobian(local_eqn,local_unknown) -=
1164  scaled_re*k*interpolated_utheta*psif_*testf_*W;
1165  }
1166 
1167  // Azimuthal velocity component (cosine part) V_k^C
1168  // has no contribution
1169 
1170  // Azimuthal velocity component (sine part) V_k^S
1171  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
1172  if(local_unknown >= 0)
1173  {
1174  // Stress tensor term
1175  jacobian(local_eqn,local_unknown) +=
1176  visc_ratio*Gamma[1]*k*dpsifdz*testf_*W;
1177  }
1178  } // End of loop over velocity shape functions
1179 
1180  // Now loop over pressure shape functions
1181  // (This is the contribution from pressure gradient)
1182  for(unsigned l2=0;l2<n_pres;l2++)
1183  {
1184  // Cosine part P_k^C
1185  local_unknown = p_local_eqn(l2,0);
1186  if(local_unknown >= 0)
1187  {
1188  jacobian(local_eqn,local_unknown) +=
1189  r*psip[l2]*dtestfdz*W;
1190  }
1191 
1192  // Sine part P_k^S has no contribution
1193 
1194  } // End of loop over pressure shape functions
1195  } // End of Jacobian calculation
1196 
1197  } // End of if not boundary condition statement
1198 
1199  // -------------------------------------------
1200  // FOURTH (AXIAL) MOMENTUM EQUATION: SINE PART
1201  // -------------------------------------------
1202 
1203  // Get local equation number of fourth velocity value at this node
1204  local_eqn = nodal_local_eqn(l,u_nodal_index[3]);
1205 
1206  // If it's not a boundary condition
1207  if(local_eqn >= 0)
1208  {
1209  // Pressure gradient term
1210  residuals[local_eqn] += r*interpolated_PS*dtestfdz*W;
1211 
1212  // Stress tensor terms
1213  residuals[local_eqn] -= visc_ratio*r*
1214  (interpolated_dWSdr + Gamma[1]*interpolated_dUSdz)
1215  *dtestfdr*W;
1216 
1217  residuals[local_eqn] -= visc_ratio*r*
1218  (1.0+Gamma[1])*interpolated_dWSdz*dtestfdz*W;
1219 
1220  residuals[local_eqn] -= visc_ratio*k*
1221  (Gamma[1]*interpolated_dVCdz + k*interpolated_WS/r)*testf_*W;
1222 
1223  // Inertial terms (du/dt)
1224  residuals[local_eqn] -= scaled_re_st*r*dudt[3]*testf_*W;
1225 
1226  // Inertial terms (convective)
1227  residuals[local_eqn] -=
1228  scaled_re*(r*interpolated_ur*interpolated_dWSdr
1229  + r*interpolated_duzdr*interpolated_US
1230  - k*interpolated_utheta*interpolated_WC
1231  + r*interpolated_uz*interpolated_dWSdz
1232  + r*interpolated_duzdz*interpolated_WS)*testf_*W;
1233 
1234  // Mesh velocity terms
1235  if(!ALE_is_disabled)
1236  {
1237  for(unsigned j=0;j<2;j++)
1238  {
1239  residuals[local_eqn] +=
1240  scaled_re_st*r*mesh_velocity[j]
1241  *interpolated_dudx(3,j)*testf_*W;
1242  }
1243  }
1244 
1245  // Calculate the Jacobian
1246  // ----------------------
1247 
1248  if(flag)
1249  {
1250  // Loop over the velocity shape functions again
1251  for(unsigned l2=0;l2<n_node;l2++)
1252  {
1253  // Cache velocity shape functions and their derivatives
1254  const double psif_ = psif[l2];
1255  const double dpsifdr = dpsifdx(l2,0);
1256  const double dpsifdz = dpsifdx(l2,1);
1257 
1258  // Radial velocity component (cosine part) U_k^C
1259  // has no contribution
1260 
1261  // Radial velocity component (sine part) U_k^S
1262  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
1263  if(local_unknown >= 0)
1264  {
1265  // Stress tensor term
1266  jacobian(local_eqn,local_unknown) -=
1267  visc_ratio*r*Gamma[1]*dpsifdz*dtestfdr*W;
1268 
1269  // Convective term
1270  jacobian(local_eqn,local_unknown) -=
1271  scaled_re*r*psif_*interpolated_duzdr*testf_*W;
1272  }
1273 
1274  // Axial velocity component (cosine part) W_k^S
1275  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
1276  if(local_unknown >= 0)
1277  {
1278  // Convective term
1279  jacobian(local_eqn,local_unknown) +=
1280  scaled_re*k*interpolated_utheta*psif_*testf_*W;
1281  }
1282 
1283  // Axial velocity component (sine part) W_k^S
1284  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
1285  if(local_unknown >= 0)
1286  {
1287  if(flag==2)
1288  {
1289  // Add the mass matrix
1290  mass_matrix(local_eqn,local_unknown) +=
1291  scaled_re_st*r*psif_*testf_*W;
1292  }
1293 
1294  // Add contributions to the Jacobian matrix
1295 
1296  // Stress tensor terms
1297  jacobian(local_eqn,local_unknown) -=
1298  visc_ratio*r*dpsifdr*dtestfdr*W;
1299 
1300  jacobian(local_eqn,local_unknown) -=
1301  visc_ratio*r*(1.0+Gamma[1])*dpsifdz*dtestfdz*W;
1302 
1303  jacobian(local_eqn,local_unknown) -=
1304  visc_ratio*k*k*psif_*testf_*W/r;
1305 
1306  // Inertial terms (du/dt)
1307  jacobian(local_eqn,local_unknown) -=
1308  scaled_re_st*r*node_pt(l2)->time_stepper_pt()->weight(1,0)*
1309  psif_*testf_*W;
1310 
1311  // Inertial terms (convective)
1312  jacobian(local_eqn,local_unknown) -=
1313  scaled_re*r*(interpolated_ur*dpsifdr
1314  + psif_*interpolated_duzdz
1315  + interpolated_uz*dpsifdz)*testf_*W;
1316 
1317 
1318  // Mesh velocity terms
1319  if(!ALE_is_disabled)
1320  {
1321  for(unsigned j=0;j<2;j++)
1322  {
1323  jacobian(local_eqn,local_unknown) +=
1324  scaled_re_st*r*mesh_velocity[j]
1325  *dpsifdx(l2,j)*testf_*W;
1326  }
1327  }
1328  }
1329 
1330  // Azimuthal velocity component (cosine part) V_k^C
1331  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
1332  if(local_unknown >= 0)
1333  {
1334  // Stress tensor term
1335  jacobian(local_eqn,local_unknown) -=
1336  visc_ratio*Gamma[1]*k*dpsifdz*testf_*W;
1337  }
1338 
1339  // Azimuthal velocity component (sine part) V_k^S
1340  // has no contribution
1341 
1342  } // End of loop over velocity shape functions
1343 
1344  // Now loop over pressure shape functions
1345  // (This is the contribution from pressure gradient)
1346  for(unsigned l2=0;l2<n_pres;l2++)
1347  {
1348  // Cosine part P_k^C has no contribution
1349 
1350  // Sine part P_k^S
1351  local_unknown = p_local_eqn(l2,1);
1352  if(local_unknown >= 0)
1353  {
1354  jacobian(local_eqn,local_unknown) +=
1355  r*psip[l2]*dtestfdz*W;
1356  }
1357  } // End of loop over pressure shape functions
1358  } // End of Jacobian calculation
1359 
1360  } // End of if not boundary condition statement
1361 
1362  // ------------------------------------------------
1363  // FIFTH (AZIMUTHAL) MOMENTUM EQUATION: COSINE PART
1364  // ------------------------------------------------
1365 
1366  // Get local equation number of fifth velocity value at this node
1367  local_eqn = nodal_local_eqn(l,u_nodal_index[4]);
1368 
1369  // If it's not a boundary condition
1370  if(local_eqn >= 0)
1371  {
1372  // Pressure gradient term
1373  residuals[local_eqn] -= k*interpolated_PS*testf_*W;
1374 
1375  // Stress tensor terms
1376  residuals[local_eqn] += visc_ratio*
1377  (-r*interpolated_dVCdr
1378  - k*Gamma[0]*interpolated_US
1379  + Gamma[0]*interpolated_VC)*dtestfdr*W;
1380 
1381  residuals[local_eqn] -= visc_ratio*
1382  (k*Gamma[0]*interpolated_WS + r*interpolated_dVCdz)*dtestfdz*W;
1383 
1384  residuals[local_eqn] += visc_ratio*
1385  (Gamma[0]*interpolated_dVCdr
1386  + k*(2.0+Gamma[0])*interpolated_US/r
1387  - (1.0+(k*k)+(k*k*Gamma[0]))*interpolated_VC/r)*testf_*W;
1388 
1389  // Inertial terms (du/dt)
1390  residuals[local_eqn] -= scaled_re_st*r*dudt[4]*testf_*W;
1391 
1392  // Inertial terms (convective)
1393  residuals[local_eqn] -=
1394  scaled_re*(r*interpolated_ur*interpolated_dVCdr
1395  + r*interpolated_duthetadr*interpolated_UC
1396  + k*interpolated_utheta*interpolated_VS
1397  + interpolated_utheta*interpolated_UC
1398  + interpolated_ur*interpolated_VC
1399  + r*interpolated_uz*interpolated_dVCdz
1400  + r*interpolated_duthetadz*interpolated_WC)*testf_*W;
1401 
1402  // Mesh velocity terms
1403  if(!ALE_is_disabled)
1404  {
1405  for(unsigned j=0;j<2;j++)
1406  {
1407  residuals[local_eqn] +=
1408  scaled_re_st*r*mesh_velocity[j]
1409  *interpolated_dudx(4,j)*testf_*W;
1410  }
1411  }
1412 
1413  // Calculate the Jacobian
1414  // ----------------------
1415 
1416  if(flag)
1417  {
1418  // Loop over the velocity shape functions again
1419  for(unsigned l2=0;l2<n_node;l2++)
1420  {
1421  // Cache velocity shape functions and their derivatives
1422  const double psif_ = psif[l2];
1423  const double dpsifdr = dpsifdx(l2,0);
1424  const double dpsifdz = dpsifdx(l2,1);
1425 
1426  // Radial velocity component (cosine part) U_k^C
1427  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
1428  if(local_unknown >= 0)
1429  {
1430  // Convective terms
1431  jacobian(local_eqn,local_unknown) -=
1432  scaled_re*(r*interpolated_duthetadr
1433  + interpolated_utheta)*psif_*testf_*W;
1434  }
1435 
1436  // Radial velocity component (sine part) U_k^S
1437  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
1438  if(local_unknown >= 0)
1439  {
1440  // Stress tensor terms
1441  jacobian(local_eqn,local_unknown) += visc_ratio*k*psif_*(
1442  ((2.0+Gamma[0])*testf_/r) - (Gamma[0]*dtestfdr))*W;
1443  }
1444 
1445  // Axial velocity component (cosine part) W_k^C
1446  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
1447  if(local_unknown >= 0)
1448  {
1449  // Convective term
1450  jacobian(local_eqn,local_unknown) -=
1451  scaled_re*r*psif_*interpolated_duthetadz*testf_*W;
1452  }
1453 
1454  // Axial velocity component (sine part) W_k^S
1455  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
1456  if(local_unknown >= 0)
1457  {
1458  // Stress tensor term
1459  jacobian(local_eqn,local_unknown) -=
1460  visc_ratio*k*Gamma[0]*psif_*dtestfdz*W;
1461  }
1462 
1463  // Azimuthal velocity component (cosine part) V_k^C
1464  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
1465  if(local_unknown >= 0)
1466  {
1467  if(flag==2)
1468  {
1469  // Add the mass matrix
1470  mass_matrix(local_eqn,local_unknown) +=
1471  scaled_re_st*r*psif_*testf_*W;
1472  }
1473 
1474  // Add contributions to the Jacobian matrix
1475 
1476  // Stress tensor terms
1477  jacobian(local_eqn,local_unknown) +=
1478  visc_ratio*(Gamma[0]*psif_ - r*dpsifdr)*dtestfdr*W;
1479 
1480  jacobian(local_eqn,local_unknown) -=
1481  visc_ratio*r*dpsifdz*dtestfdz*W;
1482 
1483  jacobian(local_eqn,local_unknown) +=
1484  visc_ratio*(Gamma[0]*dpsifdr
1485  - (1.0+(k*k)+(k*k*Gamma[0]))*psif_/r)*testf_*W;
1486 
1487  // Inertial terms (du/dt)
1488  jacobian(local_eqn,local_unknown) -=
1489  scaled_re_st*r*node_pt(l2)->time_stepper_pt()->weight(1,0)*
1490  psif_*testf_*W;
1491 
1492  // Inertial terms (convective)
1493  jacobian(local_eqn,local_unknown) -=
1494  scaled_re*(r*interpolated_ur*dpsifdr
1495  + interpolated_ur*psif_
1496  + r*interpolated_uz*dpsifdz)*testf_*W;
1497 
1498  // Mesh velocity terms
1499  if(!ALE_is_disabled)
1500  {
1501  for(unsigned j=0;j<2;j++)
1502  {
1503  jacobian(local_eqn,local_unknown) +=
1504  scaled_re_st*r*mesh_velocity[j]
1505  *dpsifdx(l2,j)*testf_*W;
1506  }
1507  }
1508  }
1509 
1510  // Azimuthal velocity component (sine part) V_k^S
1511  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
1512  if(local_unknown >= 0)
1513  {
1514  // Convective term
1515  jacobian(local_eqn,local_unknown) -=
1516  scaled_re*k*interpolated_utheta*psif_*testf_*W;
1517  }
1518  } // End of loop over velocity shape functions
1519 
1520  // Now loop over pressure shape functions
1521  // (This is the contribution from pressure gradient)
1522  for(unsigned l2=0;l2<n_pres;l2++)
1523  {
1524  // Cosine part P_k^C has no contribution
1525 
1526  // Sine part P_k^S
1527  local_unknown = p_local_eqn(l2,1);
1528  if(local_unknown >= 0)
1529  {
1530  jacobian(local_eqn,local_unknown) -=
1531  k*psip[l2]*testf_*W;
1532  }
1533  } // End of loop over pressure shape functions
1534  } // End of Jacobian calculation
1535 
1536  } // End of if not boundary condition statement
1537 
1538  // ----------------------------------------------
1539  // SIXTH (AZIMUTHAL) MOMENTUM EQUATION: SINE PART
1540  // ----------------------------------------------
1541 
1542  // Get local equation number of sixth velocity value at this node
1543  local_eqn = nodal_local_eqn(l,u_nodal_index[5]);
1544 
1545  // If it's not a boundary condition
1546  if(local_eqn >= 0)
1547  {
1548  // Pressure gradient term
1549  residuals[local_eqn] += k*interpolated_PC*testf_*W;
1550 
1551  // Stress tensor terms
1552  residuals[local_eqn] += visc_ratio*
1553  (-r*interpolated_dVSdr
1554  + k*Gamma[0]*interpolated_UC
1555  + Gamma[0]*interpolated_VS)*dtestfdr*W;
1556 
1557  residuals[local_eqn] += visc_ratio*
1558  (k*Gamma[0]*interpolated_WC - r*interpolated_dVSdz)*dtestfdz*W;
1559 
1560  residuals[local_eqn] += visc_ratio*
1561  (Gamma[0]*interpolated_dVSdr
1562  - k*(2.0+Gamma[0])*interpolated_UC/r
1563  - (1.0+(k*k)+(k*k*Gamma[0]))*interpolated_VS/r)*testf_*W;
1564 
1565  // Inertial terms (du/dt)
1566  residuals[local_eqn] -= scaled_re_st*r*dudt[5]*testf_*W;
1567 
1568  // Inertial terms (convective)
1569  residuals[local_eqn] -=
1570  scaled_re*(r*interpolated_ur*interpolated_dVSdr
1571  + r*interpolated_duthetadr*interpolated_US
1572  - k*interpolated_utheta*interpolated_VC
1573  + interpolated_utheta*interpolated_US
1574  + interpolated_ur*interpolated_VS
1575  + r*interpolated_uz*interpolated_dVSdz
1576  + r*interpolated_duthetadz*interpolated_WS)*testf_*W;
1577 
1578  // Mesh velocity terms
1579  if(!ALE_is_disabled)
1580  {
1581  for(unsigned j=0;j<2;j++)
1582  {
1583  residuals[local_eqn] +=
1584  scaled_re_st*r*mesh_velocity[j]
1585  *interpolated_dudx(5,j)*testf_*W;
1586  }
1587  }
1588 
1589  // Calculate the Jacobian
1590  // ----------------------
1591 
1592  if(flag)
1593  {
1594  // Loop over the velocity shape functions again
1595  for(unsigned l2=0;l2<n_node;l2++)
1596  {
1597  // Cache velocity shape functions and their derivatives
1598  const double psif_ = psif[l2];
1599  const double dpsifdr = dpsifdx(l2,0);
1600  const double dpsifdz = dpsifdx(l2,1);
1601 
1602  // Radial velocity component (cosine part) U_k^C
1603  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
1604  if(local_unknown >= 0)
1605  {
1606  // Stress tensor terms
1607  jacobian(local_eqn,local_unknown) += visc_ratio*k*psif_*(
1608  (Gamma[0]*dtestfdr) - ((2.0+Gamma[0])*testf_/r))*W;
1609  }
1610 
1611  // Radial velocity component (sine part) U_k^S
1612  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
1613  if(local_unknown >= 0)
1614  {
1615  // Convective terms
1616  jacobian(local_eqn,local_unknown) -=
1617  scaled_re*(r*interpolated_duthetadr
1618  + interpolated_utheta)*psif_*testf_*W;
1619  }
1620 
1621  // Axial velocity component (cosine part) W_k^C
1622  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
1623  if(local_unknown >= 0)
1624  {
1625  // Stress tensor term
1626  jacobian(local_eqn,local_unknown) +=
1627  visc_ratio*k*Gamma[0]*psif_*dtestfdz*W;
1628  }
1629 
1630  // Axial velocity component (sine part) W_k^S
1631  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
1632  if(local_unknown >= 0)
1633  {
1634  // Convective term
1635  jacobian(local_eqn,local_unknown) -=
1636  scaled_re*r*psif_*interpolated_duthetadz*testf_*W;
1637  }
1638 
1639  // Azimuthal velocity component (cosine part) V_k^C
1640  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
1641  if(local_unknown >= 0)
1642  {
1643  // Convective term
1644  jacobian(local_eqn,local_unknown) +=
1645  scaled_re*k*interpolated_utheta*psif_*testf_*W;
1646  }
1647 
1648  // Azimuthal velocity component (sine part) V_k^S
1649  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
1650  if(local_unknown >= 0)
1651  {
1652  if(flag==2)
1653  {
1654  // Add the mass matrix
1655  mass_matrix(local_eqn,local_unknown) +=
1656  scaled_re_st*r*psif_*testf_*W;
1657  }
1658 
1659  // Add contributions to the Jacobian matrix
1660 
1661  // Stress tensor terms
1662  jacobian(local_eqn,local_unknown) +=
1663  visc_ratio*(Gamma[0]*psif_ - r*dpsifdr)*dtestfdr*W;
1664 
1665  jacobian(local_eqn,local_unknown) -=
1666  visc_ratio*r*dpsifdz*dtestfdz*W;
1667 
1668  jacobian(local_eqn,local_unknown) +=
1669  visc_ratio*(Gamma[0]*dpsifdr
1670  - (1.0+(k*k)+(k*k*Gamma[0]))*psif_/r)*testf_*W;
1671 
1672  // Inertial terms (du/dt)
1673  jacobian(local_eqn,local_unknown) -=
1674  scaled_re_st*r*node_pt(l2)->time_stepper_pt()->weight(1,0)*
1675  psif_*testf_*W;
1676 
1677  // Convective terms
1678  jacobian(local_eqn,local_unknown) -=
1679  scaled_re*(r*interpolated_ur*dpsifdr
1680  + interpolated_ur*psif_
1681  + r*interpolated_uz*dpsifdz)*testf_*W;
1682 
1683  // Mesh velocity terms
1684  if(!ALE_is_disabled)
1685  {
1686  for(unsigned j=0;j<2;j++)
1687  {
1688  jacobian(local_eqn,local_unknown) +=
1689  scaled_re_st*r*mesh_velocity[j]
1690  *dpsifdx(l2,j)*testf_*W;
1691  }
1692  }
1693  }
1694  } // End of loop over velocity shape functions
1695 
1696  // Now loop over pressure shape functions
1697  // (This is the contribution from pressure gradient)
1698  for(unsigned l2=0;l2<n_pres;l2++)
1699  {
1700  // Cosine part P_k^C
1701  local_unknown = p_local_eqn(l2,0);
1702  if(local_unknown >= 0)
1703  {
1704  jacobian(local_eqn,local_unknown) +=
1705  k*psip[l2]*testf_*W;
1706  }
1707 
1708  // Sine part P_k^S has no contribution
1709 
1710  } // End of loop over pressure shape functions
1711  } // End of Jacobian calculation
1712 
1713  } // End of if not boundary condition statement
1714 
1715  } // End of loop over shape functions
1716 
1717 
1718  // ====================
1719  // CONTINUITY EQUATIONS
1720  // ====================
1721 
1722  // Loop over the pressure shape functions
1723  for(unsigned l=0;l<n_pres;l++)
1724  {
1725  // Cache test function
1726  const double testp_ = testp[l];
1727 
1728  // --------------------------------------
1729  // FIRST CONTINUITY EQUATION: COSINE PART
1730  // --------------------------------------
1731 
1732  // Get local equation number of first pressure value at this node
1733  local_eqn = p_local_eqn(l,0);
1734 
1735  // If it's not a boundary condition
1736  if(local_eqn >= 0)
1737  {
1738  // Gradient terms
1739  residuals[local_eqn] +=
1740  (interpolated_UC + r*interpolated_dUCdr
1741  + k*interpolated_VS + r*interpolated_dWCdz)*testp_*W;
1742 
1743  // Calculate the Jacobian
1744  // ----------------------
1745 
1746  if(flag)
1747  {
1748  // Loop over the velocity shape functions
1749  for(unsigned l2=0;l2<n_node;l2++)
1750  {
1751  // Cache velocity shape functions and their derivatives
1752  const double psif_ = psif[l2];
1753  const double dpsifdr = dpsifdx(l2,0);
1754  const double dpsifdz = dpsifdx(l2,1);
1755 
1756  // Radial velocity component (cosine part) U_k^C
1757  local_unknown = nodal_local_eqn(l2,u_nodal_index[0]);
1758  if(local_unknown >= 0)
1759  {
1760  jacobian(local_eqn,local_unknown) +=
1761  (psif_ + r*dpsifdr)*testp_*W;
1762  }
1763 
1764  // Radial velocity component (sine part) U_k^S
1765  // has no contribution
1766 
1767  // Axial velocity component (cosine part) W_k^C
1768  local_unknown = nodal_local_eqn(l2,u_nodal_index[2]);
1769  if(local_unknown >= 0)
1770  {
1771  jacobian(local_eqn,local_unknown) +=
1772  r*dpsifdz*testp_*W;
1773  }
1774 
1775  // Axial velocity component (sine part) W_k^S
1776  // has no contribution
1777 
1778  // Azimuthal velocity component (cosine part) V_k^C
1779  // has no contribution
1780 
1781  // Azimuthal velocity component (sine part) V_k^S
1782  local_unknown = nodal_local_eqn(l2,u_nodal_index[5]);
1783  if(local_unknown >= 0)
1784  {
1785  jacobian(local_eqn,local_unknown) +=
1786  k*psif_*testp_*W;
1787  }
1788  } // End of loop over velocity shape functions
1789 
1790  // Real and imaginary pressure components, P_k^C and P_k^S,
1791  // have no contribution
1792 
1793  } // End of Jacobian calculation
1794 
1795  } // End of if not boundary condition statement
1796 
1797  // -------------------------------------
1798  // SECOND CONTINUITY EQUATION: SINE PART
1799  // -------------------------------------
1800 
1801  // Get local equation number of second pressure value at this node
1802  local_eqn = p_local_eqn(l,1);
1803 
1804  // If it's not a boundary condition
1805  if(local_eqn >= 0)
1806  {
1807  // Gradient terms
1808  residuals[local_eqn] +=
1809  (interpolated_US + r*interpolated_dUSdr
1810  - k*interpolated_VC + r*interpolated_dWSdz)*testp_*W;
1811 
1812  // Calculate the Jacobian
1813  // ----------------------
1814 
1815  if(flag)
1816  {
1817  // Loop over the velocity shape functions
1818  for(unsigned l2=0;l2<n_node;l2++)
1819  {
1820  // Cache velocity shape functions and their derivatives
1821  const double psif_ = psif[l2];
1822  const double dpsifdr = dpsifdx(l2,0);
1823  const double dpsifdz = dpsifdx(l2,1);
1824 
1825  // Radial velocity component (cosine part) U_k^C
1826  // has no contribution
1827 
1828  // Radial velocity component (sine part) U_k^S
1829  local_unknown = nodal_local_eqn(l2,u_nodal_index[1]);
1830  if(local_unknown >= 0)
1831  {
1832  jacobian(local_eqn,local_unknown) +=
1833  (psif_ + r*dpsifdr)*testp_*W;
1834  }
1835 
1836  // Axial velocity component (cosine part) W_k^C
1837  // has no contribution
1838 
1839  // Axial velocity component (sine part) W_k^S
1840  local_unknown = nodal_local_eqn(l2,u_nodal_index[3]);
1841  if(local_unknown >= 0)
1842  {
1843  jacobian(local_eqn,local_unknown) +=
1844  r*dpsifdz*testp_*W;
1845  }
1846 
1847  // Azimuthal velocity component (cosine part) V_k^C
1848  local_unknown = nodal_local_eqn(l2,u_nodal_index[4]);
1849  if(local_unknown >= 0)
1850  {
1851  jacobian(local_eqn,local_unknown) -=
1852  k*psif_*testp_*W;
1853  }
1854 
1855  // Azimuthal velocity component (sine part) V_k^S
1856  // has no contribution
1857 
1858  } // End of loop over velocity shape functions
1859 
1860  // Real and imaginary pressure components, P_k^C and P_k^S,
1861  // have no contribution
1862 
1863  } // End of Jacobian calculation
1864 
1865  } // End of if not boundary condition statement
1866 
1867  } // End of loop over pressure shape functions
1868 
1869  } // End of loop over the integration points
1870 
1871  } // End of fill_in_generic_residual_contribution_linearised_axi_nst
double du_dt_linearised_axi_nst(const unsigned &n, const unsigned &i) const
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:289
virtual void pshape_linearised_axi_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
virtual double dshape_and_dtest_eulerian_at_knot_linearised_axi_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
virtual unsigned npres_linearised_axi_nst() const =0
virtual double p_linearised_axi_nst(const unsigned &n_p, const unsigned &i) const =0
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
@ W
Definition: quadtree.h:63

References ALE_is_disabled, azimuthal_mode_number(), density_ratio(), dshape_and_dtest_eulerian_at_knot_linearised_axi_nst(), du_dt_linearised_axi_nst(), Gamma, get_base_flow_dudx(), get_base_flow_u(), i, oomph::FiniteElement::integral_pt(), oomph::FiniteElement::interpolated_x(), J, j, k, oomph::Integral::knot(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_local_eqn(), oomph::FiniteElement::node_pt(), npres_linearised_axi_nst(), oomph::Integral::nweight(), p_linearised_axi_nst(), p_local_eqn(), pshape_linearised_axi_nst(), UniformPSDSelfTest::r, oomph::FiniteElement::raw_dnodal_position_dt(), oomph::FiniteElement::raw_nodal_position(), oomph::FiniteElement::raw_nodal_value(), re(), re_st(), s, oomph::Time::time(), oomph::TimeStepper::time_pt(), oomph::Data::time_stepper_pt(), u_index_linearised_axi_nst(), viscosity_ratio(), w, oomph::QuadTreeNames::W, oomph::Integral::weight(), and oomph::TimeStepper::weight().

Referenced by fill_in_contribution_to_jacobian(), fill_in_contribution_to_jacobian_and_mass_matrix(), and fill_in_contribution_to_residuals().

◆ fill_in_generic_residual_contribution_linearised_axi_nst() [2/2]

virtual void oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_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.

Reimplemented in oomph::RefineableLinearisedAxisymmetricNavierStokesEquations, and oomph::RefineableLinearisedAxisymmetricNavierStokesEquations.

◆ g()

const Vector<double>& oomph::LinearisedAxisymmetricNavierStokesEquations::g ( ) const
inline

Vector of gravitational components.

496 {return *G_pt;}

References G_pt.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst().

◆ g_pt()

Vector<double>* & oomph::LinearisedAxisymmetricNavierStokesEquations::g_pt ( )
inline

Pointer to Vector of gravitational components.

499 {return G_pt;}

References G_pt.

◆ get_base_flow_d_dudx_dX()

virtual void oomph::LinearisedAxisymmetricNavierStokesEquations::get_base_flow_d_dudx_dX ( const double time,
const unsigned ipt,
const Vector< double > &  x,
RankFourTensor< double > &  result 
) const
inlineprotectedvirtual

Calculate the derivatives w.r.t. nodal coordinates X_{pq} of the spatial derivatives of the velocity components of the base flow solution at a given time and Eulerian position

283  {
284  // If the function pointer is zero return zero
286  {
287  // Determine number of nodes in this element
288  const unsigned n_node = nnode();
289 
290  // Loop over the element's nodes
291  for(unsigned q=0;q<n_node;q++)
292  {
293  // Loop over the two coordinate directions
294  for(unsigned p=0;p<2;p++)
295  {
296  // Loop over velocity components
297  for(unsigned i=0;i<3;i++)
298  {
299  // Loop over coordinate directions and set to zero
300  for(unsigned k=0;k<2;k++) { result(p,q,i,k) = 0.0; }
301  }
302  }
303  }
304  }
305  // Otherwise call the function
306  else
307  {
308  (*Base_flow_d_dudx_dX_fct_pt)(time,x,result);
309  }
310  }
float * p
Definition: Tutorial_Map_using.cpp:9
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:2019
list x
Definition: plotDoE.py:28

References Base_flow_d_dudx_dX_fct_pt, i, k, oomph::FiniteElement::nnode(), p, Eigen::numext::q, and plotDoE::x.

◆ get_base_flow_duds()

virtual void oomph::LinearisedAxisymmetricNavierStokesEquations::get_base_flow_duds ( 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. local coordinates (s_1 and s_2) at a given time and Eulerian position

Reimplemented in LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement.

402  {
403  // If the function pointer is zero return zero
404  if(Base_flow_duds_fct_pt==0)
405  {
406  // Loop over velocity components
407  for(unsigned i=0;i<3;i++)
408  {
409  // Loop over coordinate directions and set to zero
410  for(unsigned j=0;j<2;j++) { result(i,j) = 0.0; }
411  }
412  }
413  // Otherwise call the function
414  else
415  {
416  (*Base_flow_duds_fct_pt)(time,x,result);
417  }
418  }

References Base_flow_duds_fct_pt, i, j, and plotDoE::x.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst().

◆ get_base_flow_dudt()

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

Calculate the derivative of the velocity components of the base flow solution w.r.t. time at a given time and Eulerian position

Reimplemented in LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement.

248  {
249  // If the function pointer is zero return zero
250  if(Base_flow_dudt_fct_pt==0)
251  {
252  // Loop over velocity components and set to zero
253  for(unsigned i=0;i<3;i++) { result[i] = 0.0; }
254  }
255  // Otherwise call the function
256  else
257  {
258  (*Base_flow_dudt_fct_pt)(time,x,result);
259  }
260  }

References Base_flow_dudt_fct_pt, i, and plotDoE::x.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst().

◆ get_base_flow_dudx() [1/3]

virtual void oomph::LinearisedAxisymmetricNavierStokesEquations::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 RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, LinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, and LinearisedAxisymmetricQTaylorHoodMultiDomainElement.

168  {
169  // If the function pointer is zero return zero
170  if(Base_flow_dudx_fct_pt==0)
171  {
172  // Loop over velocity components
173  for(unsigned i=0;i<3;i++)
174  {
175  // Loop over coordinate directions and set to zero
176  for(unsigned j=0;j<2;j++) { result(i,j) = 0.0; }
177  }
178  }
179  // Otherwise call the function
180  else
181  {
182  (*Base_flow_dudx_fct_pt)(time,x,result);
183  }
184  }

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

Referenced by fill_in_generic_residual_contribution_lin_axi_nst(), fill_in_generic_residual_contribution_linearised_axi_nst(), and oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_nst().

◆ get_base_flow_dudx() [2/3]

virtual void oomph::LinearisedAxisymmetricNavierStokesEquations::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 RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, LinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, and LinearisedAxisymmetricQTaylorHoodMultiDomainElement.

224  {
225  // If the function pointer is zero return zero
226  if(Base_flow_dudx_fct_pt==0)
227  {
228  // Loop over velocity components
229  for(unsigned i=0;i<3;i++)
230  {
231  // Loop over coordinate directions and set to zero
232  for(unsigned j=0;j<2;j++) { result(i,j) = 0.0; }
233  }
234  }
235  // Otherwise call the function
236  else
237  {
238  (*Base_flow_dudx_fct_pt)(time,x,result);
239  }
240  }

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

◆ get_base_flow_dudx() [3/3]

virtual void oomph::LinearisedAxisymmetricNavierStokesEquations::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 RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, LinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, and LinearisedAxisymmetricQTaylorHoodMultiDomainElement.

167  {
168  // If the function pointer is zero return zero
169  if (Base_flow_dudx_fct_pt == 0)
170  {
171  // Loop over velocity components
172  for (unsigned i = 0; i < 3; i++)
173  {
174  // Loop over coordinate directions and set to zero
175  for (unsigned j = 0; j < 2; j++)
176  {
177  result(i, j) = 0.0;
178  }
179  }
180  }
181  // Otherwise call the function
182  else
183  {
184  (*Base_flow_dudx_fct_pt)(time, x, result);
185  }
186  }

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

◆ get_base_flow_p()

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

Calculate the pressure in the base flow solution at a given time and Eulerian position

Reimplemented in LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement.

268  {
269  // If the function pointer is zero return zero
270  if(Base_flow_p_fct_pt==0) { result = 0.0; }
271 
272  // Otherwise call the function
273  else { (*Base_flow_p_fct_pt)(time,x,result); }
274  }

References Base_flow_p_fct_pt, and plotDoE::x.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst().

◆ get_base_flow_u() [1/3]

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

◆ get_base_flow_u() [2/3]

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

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

Reimplemented in RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, LinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, and LinearisedAxisymmetricQTaylorHoodMultiDomainElement.

201  {
202  // If the function pointer is zero return zero
203  if(Base_flow_u_fct_pt==0)
204  {
205  // Loop over velocity components and set base flow solution to zero
206  for(unsigned i=0;i<3;i++) { result[i] = 0.0; }
207  }
208  // Otherwise call the function
209  else
210  {
211  (*Base_flow_u_fct_pt)(time,x,result);
212  }
213  }

References Base_flow_u_fct_pt, i, and plotDoE::x.

◆ get_base_flow_u() [3/3]

virtual void oomph::LinearisedAxisymmetricNavierStokesEquations::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 RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, LinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, RefineableLinearisedAxisymmetricQTaylorHoodMultiDomainElement, LinearisedAxisymmetricQCrouzeixRaviartMultiDomainElement, and LinearisedAxisymmetricQTaylorHoodMultiDomainElement.

143  {
144  // If the function pointer is zero return zero
145  if (Base_flow_u_fct_pt == 0)
146  {
147  // Loop over velocity components and set base flow solution to zero
148  for (unsigned i = 0; i < 3; i++)
149  {
150  result[i] = 0.0;
151  }
152  }
153  // Otherwise call the function
154  else
155  {
156  (*Base_flow_u_fct_pt)(time, x, result);
157  }
158  }

References Base_flow_u_fct_pt, i, and plotDoE::x.

◆ get_body_force_base_flow()

void oomph::LinearisedAxisymmetricNavierStokesEquations::get_body_force_base_flow ( const double time,
const unsigned ipt,
const Vector< double > &  x,
Vector< double > &  result 
)
inlineprotected

Calculate the body force fct of the base flow at a given time and Eulerian position

318  {
319  // If the function pointer is zero return zero
320  if(Body_force_fct_pt==0)
321  {
322  // Loop over dimensions and set body forces to zero
323  for(unsigned i=0;i<3;i++) { result[i] = 0.0; }
324  }
325  // Otherwise call the function
326  else
327  {
328  (*Body_force_fct_pt)(time,x,result);
329  }
330  }

References Body_force_fct_pt, i, and plotDoE::x.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst(), and get_body_force_gradient_base_flow().

◆ get_body_force_gradient_base_flow()

void oomph::LinearisedAxisymmetricNavierStokesEquations::get_body_force_gradient_base_flow ( const double time,
const unsigned ipt,
const Vector< double > &  x,
DenseMatrix< double > &  result 
)
inlineprotected

Calculate the gradient of the body force of the base flow at a given time and Eulerian position

351  {
352  // Reference value
353  Vector<double> body_force(3,0.0);
355 
356  // FD it
358  Vector<double> body_force_pls(3,0.0);
359  Vector<double> x_pls(x);
360  for(unsigned i=0;i<2;i++)
361  {
362  x_pls[i] += eps_fd;
363  get_body_force_base_flow(time,ipt,x_pls,body_force_pls);
364  for(unsigned j=0;j<3;j++)
365  {
366  result(j,i)=(body_force_pls[j]-body_force[j])/eps_fd;
367  }
368  x_pls[i]=x[i];
369  }
370  }
static double Default_fd_jacobian_step
Definition: elements.h:1198

References Global_Parameters::body_force(), oomph::GeneralisedElement::Default_fd_jacobian_step, get_body_force_base_flow(), i, j, and plotDoE::x.

◆ get_local_eqn_number_corresponding_to_geometric_dofs()

virtual int oomph::LinearisedAxisymmetricNavierStokesEquations::get_local_eqn_number_corresponding_to_geometric_dofs ( const unsigned n,
const unsigned i 
)
pure virtual

Return the local equation number corresponding to a particular geometric degree of freedom. This function is pure virtual because this information MUST be provided in any concrete derived classes. Note: n ranges from 0->number of PAIRS (cosine and sine) of geom dofs i ranges from 0->1 (0==cosine part, 1==sine part)

Referenced by fill_in_generic_residual_contribution_lin_axi_nst().

◆ get_source_base_flow()

double oomph::LinearisedAxisymmetricNavierStokesEquations::get_source_base_flow ( const double time,
const unsigned ipt,
const Vector< double > &  x 
)
inlineprotected

Calculate the source fct of the base flow at given time and Eulerian position

337  {
338  // If the function pointer is zero return zero
339  if(Source_fct_pt==0) { return 0; }
340 
341  // Otherwise call the function
342  else { return (*Source_fct_pt)(time,x); }
343  }

References Source_fct_pt, and plotDoE::x.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst(), and get_source_gradient_base_flow().

◆ get_source_gradient_base_flow()

void oomph::LinearisedAxisymmetricNavierStokesEquations::get_source_gradient_base_flow ( const double time,
const unsigned ipt,
const Vector< double > &  x,
Vector< double > &  result 
)
inlineprotected

Calculate the gradient of the source function of the base flow at a given time and Eulerian position

378  {
379  // Reference value
380  const double source = get_source_base_flow(time,ipt,x);
381 
382  // FD it
383  const double eps_fd = GeneralisedElement::Default_fd_jacobian_step;
384  double source_pls = 0.0;
385  Vector<double> x_pls(x);
386  for(unsigned i=0;i<2;i++)
387  {
388  x_pls[i] += eps_fd;
389  source_pls = get_source_base_flow(time,ipt,x_pls);
390  result[i] = (source_pls-source)/eps_fd;
391  x_pls[i] = x[i];
392  }
393  }

References oomph::GeneralisedElement::Default_fd_jacobian_step, get_source_base_flow(), i, TestProblem::source(), and plotDoE::x.

◆ interpolated_nodal_position_perturbation_lin_axi_nst()

double oomph::LinearisedAxisymmetricNavierStokesEquations::interpolated_nodal_position_perturbation_lin_axi_nst ( const Vector< double > &  s,
const unsigned i 
) const
inline

Return the i-th component of the FE interpolated perturbation to the nodal position xhat[i] at local coordinate s

845  {
846  // Determine number of nodes in the element
847  const unsigned n_node = nnode();
848 
849  // Provide storage for local shape functions
850  Shape psi(n_node);
851 
852  // Find values of shape functions
853  shape(s,psi);
854 
855  // Get the index at which the perturbation to the nodal position
856  // is stored
857  const unsigned xhat_nodal_index = xhat_index_lin_axi_nst(i);
858 
859  // Initialise value of xhat
860  double interpolated_xhat = 0.0;
861 
862  // Loop over the local nodes and sum
863  for(unsigned l=0;l<n_node;l++)
864  {
865  interpolated_xhat += nodal_value(l,xhat_nodal_index)*psi[l];
866  }
867 
868  return(interpolated_xhat);
869  }
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 xhat_index_lin_axi_nst().

◆ interpolated_p_lin_axi_nst()

double oomph::LinearisedAxisymmetricNavierStokesEquations::interpolated_p_lin_axi_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

816  {
817  // Determine number of pressure nodes in the element
818  const unsigned n_pressure_nodes = npres_lin_axi_nst();
819 
820  // Provide storage for local shape functions
821  Shape psi(n_pressure_nodes);
822 
823  // Find values of shape functions
824  pshape_lin_axi_nst(s,psi);
825 
826  // Initialise value of p
827  double interpolated_p = 0.0;
828 
829  // Loop over the local nodes and sum
830  for(unsigned l=0;l<n_pressure_nodes;l++)
831  {
832  // N.B. The pure virtual function p_lin_axi_nst(...)
833  // automatically calculates the index at which the pressure value
834  // is stored, so we don't need to worry about this here
835  interpolated_p += p_lin_axi_nst(l,i)*psi[l];
836  }
837 
838  return(interpolated_p);
839  }

References i, npres_lin_axi_nst(), p_lin_axi_nst(), pshape_lin_axi_nst(), and s.

◆ interpolated_p_linearised_axi_nst() [1/2]

double oomph::LinearisedAxisymmetricNavierStokesEquations::interpolated_p_linearised_axi_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

438  {
439  // Determine number of pressure nodes in the element
440  const unsigned n_pressure_nodes = npres_linearised_axi_nst();
441 
442  // Provide storage for local shape functions
443  Shape psi(n_pressure_nodes);
444 
445  // Find values of shape functions
447 
448  // Initialise value of p
449  double interpolated_p = 0.0;
450 
451  // Loop over the local nodes and sum
452  for(unsigned l=0;l<n_pressure_nodes;l++)
453  {
454  // N.B. The pure virtual function p_linearised_axi_nst(...)
455  // automatically calculates the index at which the pressure value
456  // is stored, so we don't need to worry about this here
457  interpolated_p += p_linearised_axi_nst(l,i)*psi[l];
458  }
459 
460  return(interpolated_p);
461  }

References i, npres_linearised_axi_nst(), p_linearised_axi_nst(), pshape_linearised_axi_nst(), and s.

Referenced by oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement::further_build(), oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement::get_interpolated_values(), and output().

◆ interpolated_p_linearised_axi_nst() [2/2]

double oomph::LinearisedAxisymmetricNavierStokesEquations::interpolated_p_linearised_axi_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

480  {
481  // Determine number of pressure nodes in the element
482  const unsigned n_pressure_nodes = npres_linearised_axi_nst();
483 
484  // Provide storage for local shape functions
485  Shape psi(n_pressure_nodes);
486 
487  // Find values of shape functions
489 
490  // Initialise value of p
491  double interpolated_p = 0.0;
492 
493  // Loop over the local nodes and sum
494  for (unsigned l = 0; l < n_pressure_nodes; l++)
495  {
496  // N.B. The pure virtual function p_linearised_axi_nst(...)
497  // automatically calculates the index at which the pressure value
498  // is stored, so we don't need to worry about this here
499  interpolated_p += p_linearised_axi_nst(l, i) * psi[l];
500  }
501 
502  return (interpolated_p);
503  }

References i, npres_linearised_axi_nst(), p_linearised_axi_nst(), pshape_linearised_axi_nst(), and s.

◆ interpolated_u_lin_axi_nst()

double oomph::LinearisedAxisymmetricNavierStokesEquations::interpolated_u_lin_axi_nst ( const Vector< double > &  s,
const unsigned i 
) const
inline

Return the i-th component of the FE interpolated velocity u[i] at local coordinate s

787  {
788  // Determine number of nodes in the element
789  const unsigned n_node = nnode();
790 
791  // Provide storage for local shape functions
792  Shape psi(n_node);
793 
794  // Find values of shape functions
795  shape(s,psi);
796 
797  // Get the index at which the velocity is stored
798  const unsigned u_nodal_index = u_index_lin_axi_nst(i);
799 
800  // Initialise value of u
801  double interpolated_u = 0.0;
802 
803  // Loop over the local nodes and sum
804  for(unsigned l=0;l<n_node;l++)
805  {
806  interpolated_u += nodal_value(l,u_nodal_index)*psi[l];
807  }
808 
809  return(interpolated_u);
810  }

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

◆ interpolated_u_linearised_axi_nst() [1/2]

double oomph::LinearisedAxisymmetricNavierStokesEquations::interpolated_u_linearised_axi_nst ( const Vector< double > &  s,
const unsigned i 
) const
inline

Return the i-th component of the FE interpolated velocity u[i] at local coordinate s

409  {
410  // Determine number of nodes in the element
411  const unsigned n_node = nnode();
412 
413  // Provide storage for local shape functions
414  Shape psi(n_node);
415 
416  // Find values of shape functions
417  shape(s,psi);
418 
419  // Get the index at which the velocity is stored
420  const unsigned u_nodal_index = u_index_linearised_axi_nst(i);
421 
422  // Initialise value of u
423  double interpolated_u = 0.0;
424 
425  // Loop over the local nodes and sum
426  for(unsigned l=0;l<n_node;l++)
427  {
428  interpolated_u += nodal_value(l,u_nodal_index)*psi[l];
429  }
430 
431  return(interpolated_u);
432  }

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

Referenced by oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement::get_interpolated_values(), oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement::get_interpolated_values(), and output().

◆ interpolated_u_linearised_axi_nst() [2/2]

double oomph::LinearisedAxisymmetricNavierStokesEquations::interpolated_u_linearised_axi_nst ( const Vector< double > &  s,
const unsigned i 
) const
inline

Return the i-th component of the FE interpolated velocity u[i] at local coordinate s

451  {
452  // Determine number of nodes in the element
453  const unsigned n_node = nnode();
454 
455  // Provide storage for local shape functions
456  Shape psi(n_node);
457 
458  // Find values of shape functions
459  shape(s, psi);
460 
461  // Get the index at which the velocity is stored
462  const unsigned u_nodal_index = u_index_linearised_axi_nst(i);
463 
464  // Initialise value of u
465  double interpolated_u = 0.0;
466 
467  // Loop over the local nodes and sum
468  for (unsigned l = 0; l < n_node; l++)
469  {
470  interpolated_u += nodal_value(l, u_nodal_index) * psi[l];
471  }
472 
473  return (interpolated_u);
474  }

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

◆ nexternal_H_data()

unsigned oomph::LinearisedAxisymmetricNavierStokesEquations::nexternal_H_data ( )
inline

Return the number of external perturbed spine "heights" data.

685 { return External_node.size(); }
Vector< unsigned > External_node
Definition: demo_drivers/linearised_free_surface_axisym_navier_stokes/two_layer_interface_nonaxisym_perturbations/linearised_axisym_navier_stokes_elements.h:426

References External_node.

Referenced by assign_additional_local_eqn_numbers().

◆ npres_lin_axi_nst()

virtual unsigned oomph::LinearisedAxisymmetricNavierStokesEquations::npres_lin_axi_nst ( ) const
pure virtual

Return the number of pressure degrees of freedom associated with a single pressure component in the element

Implemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst(), and interpolated_p_lin_axi_nst().

◆ npres_linearised_axi_nst() [1/2]

◆ npres_linearised_axi_nst() [2/2]

virtual unsigned oomph::LinearisedAxisymmetricNavierStokesEquations::npres_linearised_axi_nst ( ) const
pure virtual

Return the number of pressure degrees of freedom associated with a single pressure component in the element

Implemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ output() [1/12]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

358  {
359  const unsigned nplot = 5;
360  output(file_pt,nplot);
361  }
void output(std::ostream &outfile)
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:345

References output().

◆ output() [2/12]

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

Output function in tecplot format: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S, R^C, R^S, Z^C, Z^S. Default number of plot points

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

735  {
736  const unsigned nplot = 5;
737  output(file_pt,nplot);
738  }

References output().

◆ output() [3/12]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

397  {
398  const unsigned nplot = 5;
399  output(file_pt, nplot);
400  }

References output().

◆ output() [4/12]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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: 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.

Output function in tecplot format: r, z, R^C, R^S, Z^C, Z^S, 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.

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::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

281  {
282  // Provide storage for vector of local coordinates
283  Vector<double> s(2);
284 
285  // Tecplot header info
286  fprintf(file_pt,"%s ",tecplot_zone_string(nplot).c_str());
287 
288  // Determine number of plot points
289  const unsigned n_plot_points = nplot_points(nplot);
290 
291  // Loop over plot points
292  for(unsigned iplot=0;iplot<n_plot_points;iplot++)
293  {
294  // Get local coordinates of plot point
295  get_s_plot(iplot,nplot,s);
296 
297  // Output global coordinates to file
298  for(unsigned i=0;i<2;i++) { fprintf(file_pt,"%g ",interpolated_x(s,i)); }
299 
300  // Output velocities to file
301  for(unsigned i=0;i<6;i++)
302  {
303  fprintf(file_pt,"%g ",interpolated_u_linearised_axi_nst(s,i));
304  }
305 
306  // Output pressure to file
307  for(unsigned i=0;i<2;i++)
308  {
309  fprintf(file_pt,"%g ",interpolated_p_linearised_axi_nst(s,i));
310  }
311 
312  fprintf(file_pt,"\n");
313  }
314 
315  fprintf(file_pt,"\n");
316 
317  // Write tecplot footer (e.g. FE connectivity lists)
318  write_tecplot_zone_footer(file_pt,nplot);
319 
320  } // 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_u_linearised_axi_nst(const Vector< double > &s, const unsigned &i) const
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:407
double interpolated_p_linearised_axi_nst(const Vector< double > &s, const unsigned &i) const
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:436

References oomph::FiniteElement::get_s_plot(), i, interpolated_p_linearised_axi_nst(), interpolated_u_linearised_axi_nst(), oomph::FiniteElement::interpolated_x(), oomph::FiniteElement::nplot_points(), s, oomph::FiniteElement::tecplot_zone_string(), and oomph::FiniteElement::write_tecplot_zone_footer().

◆ output() [5/12]

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

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

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ output() [6/12]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ output() [7/12]

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

◆ output() [8/12]

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

Output function in tecplot format: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S, R^C, R^S, Z^C, Z^S. Default number of plot points

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

721  {
722  const unsigned nplot = 5;
723  output(outfile,nplot);
724  }

References output().

◆ output() [9/12]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

385  {
386  const unsigned nplot = 5;
387  output(outfile, nplot);
388  }

References output().

◆ output() [10/12]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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: 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.

Output function in tecplot format: r, z, R^C, R^S, Z^C, Z^S, 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.

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::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

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

References oomph::FiniteElement::get_s_plot(), i, interpolated_p_linearised_axi_nst(), interpolated_u_linearised_axi_nst(), oomph::FiniteElement::interpolated_x(), oomph::FiniteElement::nplot_points(), s, oomph::FiniteElement::tecplot_zone_string(), and oomph::FiniteElement::write_tecplot_zone_footer().

◆ output() [11/12]

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

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

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ output() [12/12]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ output_veloc() [1/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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: Velocities only
r, z, U^C, U^S, V^C, V^S, W^C, W^S in tecplot format at specified previous timestep (t=0: present; t>0: previous timestep). Specified number of plot points in each coordinate direction.

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.

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.

65  {
66  // Determine number of nodes in element
67  const unsigned n_node = nnode();
68 
69  // Provide storage for local shape functions
70  Shape psi(n_node);
71 
72  // Provide storage for vectors of local coordinates and
73  // global coordinates and velocities
74  Vector<double> s(2);
75  Vector<double> interpolated_x(2);
76  Vector<double> interpolated_u(6);
77 
78  // Tecplot header info
79  outfile << tecplot_zone_string(nplot);
80 
81  // Determine number of plot points
82  const unsigned n_plot_points = nplot_points(nplot);
83 
84  // Loop over plot points
85  for(unsigned iplot=0;iplot<n_plot_points;iplot++)
86  {
87  // Get local coordinates of plot point
88  get_s_plot(iplot,nplot,s);
89 
90  // Get shape functions
91  shape(s,psi);
92 
93  // Loop over coordinate directions
94  for(unsigned i=0;i<2;i++)
95  {
96  // Initialise global coordinate
97  interpolated_x[i]=0.0;
98 
99  // Loop over the local nodes and sum
100  for(unsigned l=0;l<n_node;l++)
101  {
102  interpolated_x[i] += nodal_position(t,l,i)*psi[l];
103  }
104  }
105 
106  // Loop over the velocity components
107  for(unsigned i=0;i<6;i++)
108  {
109  // Get the index at which the velocity is stored
110  const unsigned u_nodal_index = u_index_linearised_axi_nst(i);
111 
112  // Initialise velocity
113  interpolated_u[i]=0.0;
114 
115  // Loop over the local nodes and sum
116  for(unsigned l=0;l<n_node;l++)
117  {
118  interpolated_u[i] += nodal_value(t,l,u_nodal_index)*psi[l];
119  }
120  }
121 
122  // Output global coordinates to file
123  for(unsigned i=0;i<2;i++) { outfile << interpolated_x[i] << " "; }
124 
125  // Output velocities to file
126  for(unsigned i=0;i<6;i++) { outfile << interpolated_u[i] << " "; }
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

References 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_axi_nst(), and oomph::FiniteElement::write_tecplot_zone_footer().

◆ output_veloc() [2/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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_veloc() [3/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::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)

◆ p_index_lin_axi_nst()

virtual int oomph::LinearisedAxisymmetricNavierStokesEquations::p_index_lin_axi_nst ( const unsigned i) const
inlinevirtual

Which nodal value represents the pressure?

Reimplemented in oomph::LinearisedAxisymmetricQTaylorHoodElement.

707  { return Pressure_not_stored_at_node; }
static int Pressure_not_stored_at_node
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/linearised_axisym_navier_stokes_elements.h:62

References Pressure_not_stored_at_node.

◆ p_index_linearised_axi_nst() [1/2]

◆ p_index_linearised_axi_nst() [2/2]

virtual int oomph::LinearisedAxisymmetricNavierStokesEquations::p_index_linearised_axi_nst ( const unsigned i) const
inlinevirtual

Which nodal value represents the pressure?

Reimplemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQTaylorHoodElement.

373  {
375  }

References Pressure_not_stored_at_node.

◆ p_lin_axi_nst()

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::p_lin_axi_nst ( const unsigned n_p,
const unsigned i 
) const
pure virtual

Return the i-th pressure value at local pressure "node" n_p. Uses suitably interpolated value for hanging nodes.

Implemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst(), and interpolated_p_lin_axi_nst().

◆ p_linearised_axi_nst() [1/2]

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::p_linearised_axi_nst ( const unsigned n_p,
const unsigned i 
) const
pure virtual

◆ p_linearised_axi_nst() [2/2]

virtual double oomph::LinearisedAxisymmetricNavierStokesEquations::p_linearised_axi_nst ( const unsigned n_p,
const unsigned i 
) const
pure virtual

Return the i-th pressure value at local pressure "node" n_p. Uses suitably interpolated value for hanging nodes.

Implemented in oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQTaylorHoodElement, oomph::LinearisedAxisymmetricQCrouzeixRaviartElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ p_local_eqn() [1/3]

◆ p_local_eqn() [2/3]

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

◆ p_local_eqn() [3/3]

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

◆ pshape_lin_axi_nst() [1/2]

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

◆ pshape_lin_axi_nst() [2/2]

virtual void oomph::LinearisedAxisymmetricNavierStokesEquations::pshape_lin_axi_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::LinearisedAxisymmetricQTaylorHoodElement, and oomph::LinearisedAxisymmetricQCrouzeixRaviartElement.

◆ pshape_linearised_axi_nst() [1/4]

◆ pshape_linearised_axi_nst() [2/4]

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

◆ pshape_linearised_axi_nst() [3/4]

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

◆ pshape_linearised_axi_nst() [4/4]

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

◆ re() [1/3]

◆ re() [2/3]

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

Reynolds number.

472 { return *Re_pt; }

References Re_pt.

◆ re() [3/3]

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

Reynolds number.

225  {
226  return *Re_pt;
227  }

References Re_pt.

◆ re_invfr()

const double& oomph::LinearisedAxisymmetricNavierStokesEquations::re_invfr ( ) const
inline

Global inverse Froude number.

484 {return *ReInvFr_pt;}

References ReInvFr_pt.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst().

◆ re_invfr_pt()

double* & oomph::LinearisedAxisymmetricNavierStokesEquations::re_invfr_pt ( )
inline

Pointer to global inverse Froude number.

487 {return ReInvFr_pt;}

References ReInvFr_pt.

◆ re_invro()

const double& oomph::LinearisedAxisymmetricNavierStokesEquations::re_invro ( ) const
inline

Global Reynolds number multiplied by inverse Rossby number.

490 {return *ReInvRo_pt;}

References ReInvRo_pt.

◆ re_invro_pt()

double* & oomph::LinearisedAxisymmetricNavierStokesEquations::re_invro_pt ( )
inline

Pointer to global Reynolds number multiplied by inverse Rossby number.

493 {return ReInvRo_pt;}

References ReInvRo_pt.

◆ re_pt() [1/3]

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

Pointer to Reynolds number.

235 { return Re_pt; }

References Re_pt.

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

◆ re_pt() [2/3]

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

Pointer to Reynolds number.

475 { return Re_pt; }

References Re_pt.

◆ re_pt() [3/3]

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

Pointer to Reynolds number.

243  {
244  return Re_pt;
245  }

References Re_pt.

◆ re_st() [1/3]

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

◆ re_st() [2/3]

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

Product of Reynolds and Strouhal number (=Womersley number)

478 { return *ReSt_pt; }

References ReSt_pt.

◆ re_st() [3/3]

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

Product of Reynolds and Strouhal number (=Womersley number)

231  {
232  return *ReSt_pt;
233  }

References ReSt_pt.

◆ re_st_pt() [1/3]

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

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

238 { return ReSt_pt; }

References ReSt_pt.

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

◆ re_st_pt() [2/3]

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

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

481 { return ReSt_pt; }

References ReSt_pt.

◆ re_st_pt() [3/3]

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

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

249  {
250  return ReSt_pt;
251  }

References ReSt_pt.

◆ strain_rate() [1/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::strain_rate ( const Vector< double > &  s,
DenseMatrix< double > &  strainrate 
) 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} \).

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} \).

334  {
335 #ifdef PARANOID
336  if ((strainrate.ncol()!=3)||(strainrate.nrow()!=3))
337  {
338  std::ostringstream error_message;
339  error_message << "The strain rate has incorrect dimensions "
340  << strainrate.ncol() << " x "
341  << strainrate.nrow() << " Not 3" << std::endl;
342 
343  throw OomphLibError(error_message.str(),
346  }
347 #endif
348 
349  //Find out how many nodes there are in the element
350  unsigned n_node = nnode();
351 
352  //Set up memory for the shape and test functions
353  Shape psi(n_node);
354  DShape dpsidx(n_node,2);
355 
356  //Call the derivatives of the shape functions
357  dshape_eulerian(s,psi,dpsidx);
358 
359  // Radius
360  double interpolated_r = 0.0;
361 
362  // Velocity components and their derivatives
363  double UC = 0.0, US = 0.0;
364  double dUCdr = 0.0, dUSdr = 0.0;
365  double dUCdz = 0.0, dUSdz = 0.0;
366  double WC = 0.0, WS = 0.0;
367  double dWCdr = 0.0, dWSdr = 0.0;
368  double dWCdz = 0.0, dWSdz = 0.0;
369  double VC = 0.0, VS = 0.0;
370  double dVCdr = 0.0, dVSdr = 0.0;
371  double dVCdz = 0.0, dVSdz = 0.0;
372 
373  //Get the local storage for the indices
374  unsigned u_nodal_index[6];
375  for(unsigned i=0;i<6;++i) {u_nodal_index[i] = u_index_linearised_axi_nst(i);}
376 
377  // Loop over nodes to assemble velocities and their derivatives
378  // w.r.t. r and z (x_0 and x_1)
379  for(unsigned l=0;l<n_node;l++)
380  {
381  interpolated_r += nodal_position(l,0)*psi[l];
382 
383  UC += nodal_value(l,u_nodal_index[0])*psi[l];
384  US += nodal_value(l,u_nodal_index[1])*psi[l];
385  WC += nodal_value(l,u_nodal_index[2])*psi[l];
386  WS += nodal_value(l,u_nodal_index[3])*psi[l];
387  VC += nodal_value(l,u_nodal_index[4])*psi[l];
388  VS += nodal_value(l,u_nodal_index[4])*psi[l];
389 
390  dUCdr += nodal_value(l,u_nodal_index[0])*dpsidx(l,0);
391  dUSdr += nodal_value(l,u_nodal_index[1])*dpsidx(l,0);
392  dWCdr += nodal_value(l,u_nodal_index[2])*dpsidx(l,0);
393  dWSdr += nodal_value(l,u_nodal_index[3])*dpsidx(l,0);
394  dVCdr += nodal_value(l,u_nodal_index[4])*dpsidx(l,0);
395  dVSdr += nodal_value(l,u_nodal_index[5])*dpsidx(l,0);
396 
397  dUCdz += nodal_value(l,u_nodal_index[0])*dpsidx(l,1);
398  dUSdz += nodal_value(l,u_nodal_index[1])*dpsidx(l,1);
399  dWCdz += nodal_value(l,u_nodal_index[2])*dpsidx(l,1);
400  dWSdz += nodal_value(l,u_nodal_index[3])*dpsidx(l,1);
401  dVCdz += nodal_value(l,u_nodal_index[4])*dpsidx(l,1);
402  dVSdz += nodal_value(l,u_nodal_index[5])*dpsidx(l,1);
403  }
404 
405  // Cache azimuthal mode number
406  const int k = this->azimuthal_mode_number();
407 
408  // We wish to evaluate the strain-rate tensor at a value of theta
409  // such that k*theta = pi/4 radians. That way we pick up equal
410  // contributions from the real and imaginary parts of the velocities.
411  // sin(pi/4) = cos(pi/4) = 1/sqrt(2)
412  const double cosktheta = 1.0/sqrt(2);
413  const double sinktheta = cosktheta;
414 
415  // Assemble velocities and their derivatives w.r.t. r, z and theta
416  // from real and imaginary parts
417  const double ur = UC*cosktheta + US*sinktheta;
418  const double utheta = VC*cosktheta + VS*sinktheta;
419 
420  const double durdr = dUCdr*cosktheta + dUSdr*sinktheta;
421  const double durdz = dUCdz*cosktheta + dUSdz*sinktheta;
422  const double durdtheta = k*US*cosktheta - k*UC*sinktheta;
423 
424  const double duzdr = dWCdr*cosktheta + dWSdr*sinktheta;
425  const double duzdz = dWCdz*cosktheta + dWSdz*sinktheta;
426  const double duzdtheta = k*WS*cosktheta - k*WC*sinktheta;
427 
428  const double duthetadr = dVCdr*cosktheta + dVSdr*sinktheta;
429  const double duthetadz = dVCdz*cosktheta + dVSdz*sinktheta;
430  const double duthetadtheta = k*VS*cosktheta - k*VC*sinktheta;
431 
432  // Assign strain rates without negative powers of the radius
433  // and zero those with:
434  strainrate(0,0)=durdr;
435  strainrate(0,1)=0.5*(durdz+duzdr);
436  strainrate(1,0)=strainrate(0,1);
437  strainrate(0,2)=0.5*duthetadr;
438  strainrate(2,0)=strainrate(0,2);
439  strainrate(1,1)=duzdz;
440  strainrate(1,2)=0.5*duthetadz;
441  strainrate(2,1)=strainrate(1,2);
442  strainrate(2,2)=0.0;
443 
444 
445  // Overwrite the strain rates with negative powers of the radius
446  // unless we're at the origin
447  if (std::abs(interpolated_r)>1.0e-16)
448  {
449  double inverse_radius=1.0/interpolated_r;
450  strainrate(0,2)=0.5*(duthetadr + inverse_radius*(durdtheta - utheta));
451  strainrate(2,0)=strainrate(0,2);
452  strainrate(2,2)=inverse_radius*(ur + duthetadtheta);
453  strainrate(1,2)=0.5*(duthetadz + inverse_radius*duzdtheta);
454  strainrate(2,1)=strainrate(1,2);
455  }
456 
457  }
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
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_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References abs(), azimuthal_mode_number(), oomph::FiniteElement::dshape_eulerian(), i, k, oomph::DenseMatrix< T >::ncol(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_position(), oomph::FiniteElement::nodal_value(), oomph::DenseMatrix< T >::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, sqrt(), and u_index_linearised_axi_nst().

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

◆ strain_rate() [2/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::strain_rate ( const Vector< double > &  s,
DenseMatrix< double > &  strain_rate 
) const

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

◆ strain_rate() [3/3]

void oomph::LinearisedAxisymmetricNavierStokesEquations::strain_rate ( const Vector< double > &  s,
DenseMatrix< double > &  strain_rate 
) const

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

◆ u_index_lin_axi_nst()

virtual unsigned oomph::LinearisedAxisymmetricNavierStokesEquations::u_index_lin_axi_nst ( const unsigned i) const
inlinevirtual

Return the index at which the i-th unknown velocity component is stored. The default value, i+4, is appropriate for single-physics problems, since it stores the velocity components immediately after the four perturbations to the nodal positions. 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.

620  { return i+4; }

References i.

Referenced by dkin_energy_dt(), du_dt_lin_axi_nst(), fill_in_generic_residual_contribution_lin_axi_nst(), and interpolated_u_lin_axi_nst().

◆ u_index_linearised_axi_nst() [1/2]

virtual unsigned oomph::LinearisedAxisymmetricNavierStokesEquations::u_index_linearised_axi_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.

285  { return i; }

References i.

Referenced by du_dt_linearised_axi_nst(), fill_in_generic_residual_contribution_linearised_axi_nst(), oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_nst(), oomph::RefineableLinearisedAxisymmetricQTaylorHoodElement::get_interpolated_values(), oomph::RefineableLinearisedAxisymmetricQCrouzeixRaviartElement::get_interpolated_values(), interpolated_u_linearised_axi_nst(), output_veloc(), and strain_rate().

◆ u_index_linearised_axi_nst() [2/2]

virtual unsigned oomph::LinearisedAxisymmetricNavierStokesEquations::u_index_linearised_axi_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.

313  {
314  return i;
315  }

References i.

◆ viscosity_ratio() [1/3]

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

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

245 { return *Viscosity_Ratio_pt; }

References Viscosity_Ratio_pt.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst(), fill_in_generic_residual_contribution_linearised_axi_nst(), and oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_nst().

◆ viscosity_ratio() [2/3]

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

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

512 { return *Viscosity_Ratio_pt; }

References Viscosity_Ratio_pt.

◆ viscosity_ratio() [3/3]

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

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

262  {
263  return *Viscosity_Ratio_pt;
264  }

References Viscosity_Ratio_pt.

◆ viscosity_ratio_pt() [1/3]

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

Pointer to the viscosity ratio.

248 { return Viscosity_Ratio_pt; }

References Viscosity_Ratio_pt.

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

◆ viscosity_ratio_pt() [2/3]

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

Pointer to the viscosity ratio.

515 { return Viscosity_Ratio_pt; }

References Viscosity_Ratio_pt.

◆ viscosity_ratio_pt() [3/3]

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

Pointer to the viscosity ratio.

268  {
269  return Viscosity_Ratio_pt;
270  }

References Viscosity_Ratio_pt.

◆ xhat_index_lin_axi_nst()

virtual unsigned oomph::LinearisedAxisymmetricNavierStokesEquations::xhat_index_lin_axi_nst ( const unsigned i) const
inlinevirtual

Return the index at which the i-th component of the unknown perturbation to the nodal position 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.

609 { return i; }

References i.

Referenced by dnodal_position_perturbation_dt_lin_axi_nst(), fill_in_generic_residual_contribution_lin_axi_nst(), and interpolated_nodal_position_perturbation_lin_axi_nst().

Member Data Documentation

◆ ALE_is_disabled

bool oomph::LinearisedAxisymmetricNavierStokesEquations::ALE_is_disabled
protected

◆ Azimuthal_Mode_Number_pt

int * oomph::LinearisedAxisymmetricNavierStokesEquations::Azimuthal_Mode_Number_pt
protected

◆ base_flow_d_dudx_dX_fct_pt

void(* &)(const double& time, const Vector<double>& x, RankFourTensor<double>& f) oomph::LinearisedAxisymmetricNavierStokesEquations::base_flow_d_dudx_dX_fct_pt()
inline

Access function for the derivs w.r.t. nodal coords X_{pq} of the spatial derivatives of base flow velocities pointer

563  {
565  }

◆ Base_flow_d_dudx_dX_fct_pt

void(* oomph::LinearisedAxisymmetricNavierStokesEquations::Base_flow_d_dudx_dX_fct_pt) (const double &time, const Vector< double > &x, RankFourTensor< double > &result)
protected

Pointer to derivs w.r.t. nodal coords X_{pq} of spatial derivatives of base flow solution velocities function

Referenced by get_base_flow_d_dudx_dX().

◆ base_flow_duds_fct_pt

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

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

587  {
588  return Base_flow_duds_fct_pt;
589  }

◆ Base_flow_duds_fct_pt

void(* oomph::LinearisedAxisymmetricNavierStokesEquations::Base_flow_duds_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. local coordinates (s_1 and s_2) function

Referenced by get_base_flow_duds().

◆ base_flow_dudt_fct_pt

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

Access function for the derivatives of the base flow velocities w.r.t. time solution pointer

546  {
547  return Base_flow_dudt_fct_pt;
548  }

◆ Base_flow_dudt_fct_pt

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

Pointer to derivatives of base flow solution velocity components w.r.t. time function

Referenced by get_base_flow_dudt().

◆ base_flow_dudx_fct_pt

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

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

270  {
271  return Base_flow_dudx_fct_pt;
272  }

◆ Base_flow_dudx_fct_pt

void(* oomph::LinearisedAxisymmetricNavierStokesEquations::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_p_fct_pt

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

Access function for the base flow pressure pointer.

554  {
555  return Base_flow_p_fct_pt;
556  }

◆ Base_flow_p_fct_pt

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

Pointer to base flow solution (pressure) function.

Referenced by get_base_flow_p().

◆ base_flow_u_fct_pt

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

Access function for the base flow solution pointer.

Access function for the base flow velocity pointer.

261  {
262  return Base_flow_u_fct_pt;
263  }

◆ Base_flow_u_fct_pt

void(* oomph::LinearisedAxisymmetricNavierStokesEquations::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().

◆ body_force_fct_pt

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

Access function for the body-force pointer.

571  {
572  return Body_force_fct_pt;
573  }

◆ Body_force_fct_pt

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

Pointer to (base flow) body force function.

Referenced by get_body_force_base_flow().

◆ Default_Azimuthal_Mode_Number_Value

static int oomph::LinearisedAxisymmetricNavierStokesEquations::Default_Azimuthal_Mode_Number_Value
staticprivate

Static default value for the azimuthal mode number (zero)

Referenced by LinearisedAxisymmetricNavierStokesEquations().

◆ Default_Gravity_Vector

Vector< double > oomph::LinearisedAxisymmetricNavierStokesEquations::Default_Gravity_Vector
staticprivate

Static default value for the gravity vector (zero)

Referenced by LinearisedAxisymmetricNavierStokesEquations().

◆ Default_Physical_Constant_Value

static double oomph::LinearisedAxisymmetricNavierStokesEquations::Default_Physical_Constant_Value
staticprivate

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

Referenced by LinearisedAxisymmetricNavierStokesEquations().

◆ Default_Physical_Ratio_Value

static double oomph::LinearisedAxisymmetricNavierStokesEquations::Default_Physical_Ratio_Value
staticprivate
Initial value:
=
1.0

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

Referenced by LinearisedAxisymmetricNavierStokesEquations().

◆ Density_Ratio_pt

double * oomph::LinearisedAxisymmetricNavierStokesEquations::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::RefineableLinearisedAxisymmetricNavierStokesEquations::further_build(), and LinearisedAxisymmetricNavierStokesEquations().

◆ External_H_local_eqn

Vector<int> oomph::LinearisedAxisymmetricNavierStokesEquations::External_H_local_eqn
protected

Array to hold the local eqn number information for the external data

Referenced by assign_additional_local_eqn_numbers().

◆ External_node

Vector<unsigned> oomph::LinearisedAxisymmetricNavierStokesEquations::External_node
protected

Vector to keep track of the external data associated with each bulk node

Referenced by nexternal_H_data().

◆ G_pt

Vector<double>* oomph::LinearisedAxisymmetricNavierStokesEquations::G_pt
protected

Pointer to global gravity Vector.

Referenced by g(), g_pt(), and LinearisedAxisymmetricNavierStokesEquations().

◆ Gamma

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

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

Linearised axisymmetric Navier–Stokes equations static data.

Navier–Stokes equations static data.

Referenced by fill_in_generic_residual_contribution_lin_axi_nst(), fill_in_generic_residual_contribution_linearised_axi_nst(), and oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_linearised_axi_nst().

◆ Pressure_not_stored_at_node

static int oomph::LinearisedAxisymmetricNavierStokesEquations::Pressure_not_stored_at_node
staticprivate
Initial value:
=
-100

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

Referenced by p_index_lin_axi_nst(), and p_index_linearised_axi_nst().

◆ Re_pt

double * oomph::LinearisedAxisymmetricNavierStokesEquations::Re_pt
protected

◆ ReInvFr_pt

double* oomph::LinearisedAxisymmetricNavierStokesEquations::ReInvFr_pt
protected

Pointer to global Reynolds number x inverse Froude number (= Bond number / Capillary number)

Referenced by LinearisedAxisymmetricNavierStokesEquations(), re_invfr(), and re_invfr_pt().

◆ ReInvRo_pt

double* oomph::LinearisedAxisymmetricNavierStokesEquations::ReInvRo_pt
protected

Pointer to global Reynolds number x inverse Rossby number (used when in a rotating frame)

Referenced by LinearisedAxisymmetricNavierStokesEquations(), re_invro(), and re_invro_pt().

◆ ReSt_pt

double * oomph::LinearisedAxisymmetricNavierStokesEquations::ReSt_pt
protected

◆ source_fct_pt

double(* &)(const double& time, const Vector<double>& x) oomph::LinearisedAxisymmetricNavierStokesEquations::source_fct_pt()
inline

Access function for the source-function pointer.

578  {
579  return Source_fct_pt;
580  }

◆ Source_fct_pt

double(* oomph::LinearisedAxisymmetricNavierStokesEquations::Source_fct_pt) (const double &time, const Vector< double > &x)
protected

Pointer to (base flow) volumetric source function.

Referenced by get_source_base_flow().

◆ Viscosity_Ratio_pt

double * oomph::LinearisedAxisymmetricNavierStokesEquations::Viscosity_Ratio_pt
protected

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

Referenced by oomph::RefineableLinearisedAxisymmetricNavierStokesEquations::further_build(), LinearisedAxisymmetricNavierStokesEquations(), viscosity_ratio(), and viscosity_ratio_pt().


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