oomph::GeneralisedNewtonianNavierStokesEquations< DIM > Class Template Referenceabstract

#include <generalised_newtonian_navier_stokes_elements.h>

+ Inheritance diagram for oomph::GeneralisedNewtonianNavierStokesEquations< DIM >:

Public Types

typedef void(* NavierStokesBodyForceFctPt) (const double &time, const Vector< double > &x, Vector< double > &body_force)
 
typedef double(* NavierStokesSourceFctPt) (const double &time, const Vector< double > &x)
 
typedef double(* NavierStokesPressureAdvDiffSourceFctPt) (const Vector< double > &x)
 
- Public Types inherited from oomph::FiniteElement
typedef void(* SteadyExactSolutionFctPt) (const Vector< double > &, Vector< double > &)
 
typedef void(* UnsteadyExactSolutionFctPt) (const double &, const Vector< double > &, Vector< double > &)
 

Public Member Functions

 GeneralisedNewtonianNavierStokesEquations ()
 
const doublere () const
 Reynolds number. More...
 
const doublere_st () const
 Product of Reynolds and Strouhal number (=Womersley number) More...
 
double *& re_pt ()
 Pointer to Reynolds number. More...
 
double *& re_st_pt ()
 Pointer to product of Reynolds and Strouhal number (=Womersley number) More...
 
const doubleviscosity_ratio () const
 
double *& viscosity_ratio_pt ()
 Pointer to Viscosity Ratio. More...
 
const doubledensity_ratio () const
 
double *& density_ratio_pt ()
 Pointer to Density ratio. More...
 
const doublere_invfr () const
 Global inverse Froude number. More...
 
double *& re_invfr_pt ()
 Pointer to global inverse Froude number. More...
 
const Vector< double > & g () const
 Vector of gravitational components. More...
 
Vector< double > *& g_pt ()
 Pointer to Vector of gravitational components. More...
 
NavierStokesBodyForceFctPtbody_force_fct_pt ()
 Access function for the body-force pointer. More...
 
NavierStokesBodyForceFctPt body_force_fct_pt () const
 Access function for the body-force pointer. Const version. More...
 
NavierStokesSourceFctPtsource_fct_pt ()
 Access function for the source-function pointer. More...
 
NavierStokesSourceFctPt source_fct_pt () const
 Access function for the source-function pointer. Const version. More...
 
GeneralisedNewtonianConstitutiveEquation< DIM > *& constitutive_eqn_pt ()
 Access function for the constitutive equation pointer. More...
 
void use_current_strainrate_to_compute_second_invariant ()
 Switch to fully implict evaluation of non-Newtonian const eqn. More...
 
void use_extrapolated_strainrate_to_compute_second_invariant ()
 Use extrapolation for non-Newtonian const eqn. More...
 
virtual unsigned npres_nst () const =0
 Function to return number of pressure degrees of freedom. More...
 
virtual void pshape_nst (const Vector< double > &s, Shape &psi) const =0
 Compute the pressure shape functions at local coordinate s. More...
 
virtual void pshape_nst (const Vector< double > &s, Shape &psi, Shape &test) const =0
 
double u_nst (const unsigned &n, const unsigned &i) const
 
double u_nst (const unsigned &t, const unsigned &n, const unsigned &i) const
 
virtual unsigned u_index_nst (const unsigned &i) const
 
unsigned n_u_nst () const
 
double du_dt_nst (const unsigned &n, const unsigned &i) const
 
void disable_ALE ()
 
void enable_ALE ()
 
virtual double p_nst (const unsigned &n_p) const =0
 
virtual double p_nst (const unsigned &t, const unsigned &n_p) const =0
 Pressure at local pressure "node" n_p at time level t. More...
 
virtual void fix_pressure (const unsigned &p_dof, const double &p_value)=0
 Pin p_dof-th pressure dof and set it to value specified by p_value. More...
 
virtual int p_nodal_index_nst () const
 
double pressure_integral () const
 Integral of pressure over element. More...
 
void max_and_min_invariant_and_viscosity (double &min_invariant, double &max_invariant, double &min_viscosity, double &max_viscosity) const
 
double dissipation () const
 Return integral of dissipation over element. More...
 
double dissipation (const Vector< double > &s) const
 Return dissipation at local coordinate s. More...
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 Compute the vorticity vector at local coordinate s. More...
 
double kin_energy () const
 Get integral of kinetic energy over element. More...
 
double d_kin_energy_dt () const
 Get integral of time derivative of kinetic energy over element. More...
 
void strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate) const
 Strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) More...
 
void strain_rate (const unsigned &t, const Vector< double > &s, DenseMatrix< double > &strain_rate) const
 
virtual void extrapolated_strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate) const
 
virtual void extrapolated_strain_rate (const unsigned &ipt, DenseMatrix< double > &strain_rate) const
 
void get_traction (const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
 
void get_traction (const Vector< double > &s, const Vector< double > &N, Vector< double > &traction_p, Vector< double > &traction_visc_n, Vector< double > &traction_visc_t)
 
void get_load (const Vector< double > &s, const Vector< double > &N, Vector< double > &load)
 
void get_pressure_and_velocity_mass_matrix_diagonal (Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
 
unsigned nscalar_paraview () const
 
void scalar_value_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
 
std::string scalar_name_paraview (const unsigned &i) 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 full_output (std::ostream &outfile)
 
void full_output (std::ostream &outfile, const unsigned &nplot)
 
void output_veloc (std::ostream &outfile, const unsigned &nplot, const unsigned &t)
 
void output_vorticity (std::ostream &outfile, const unsigned &nplot)
 
void output_fct (std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
 
void output_fct (std::ostream &outfile, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
 
void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
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)
 
void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 Compute the element's residual Vector. More...
 
void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
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)
 
void pin_all_non_pressure_dofs (std::map< Data *, std::vector< int >> &eqn_number_backup)
 Pin all non-pressure dofs and backup eqn numbers. More...
 
virtual void get_dresidual_dnodal_coordinates (RankThreeTensor< double > &dresidual_dnodal_coordinates)
 
void interpolated_u_nst (const Vector< double > &s, Vector< double > &veloc) const
 Compute vector of FE interpolated velocity u at local coordinate s. More...
 
double interpolated_u_nst (const Vector< double > &s, const unsigned &i) const
 Return FE interpolated velocity u[i] at local coordinate s. More...
 
double interpolated_u_nst (const unsigned &t, const Vector< double > &s, const unsigned &i) const
 
virtual void dinterpolated_u_nst_ddata (const Vector< double > &s, const unsigned &i, Vector< double > &du_ddata, Vector< unsigned > &global_eqn_number)
 
virtual double interpolated_p_nst (const Vector< double > &s) const
 Return FE interpolated pressure at local coordinate s. More...
 
double interpolated_p_nst (const unsigned &t, const Vector< double > &s) const
 Return FE interpolated pressure at local coordinate s at time level t. More...
 
void point_output_data (const Vector< double > &s, Vector< double > &data)
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 Compute 3D vorticity vector at local coordinate s. More...
 
- Public Member Functions inherited from oomph::FSIFluidElement
 FSIFluidElement ()
 Constructor. More...
 
 FSIFluidElement (const FSIFluidElement &)=delete
 Broken copy constructor. More...
 
void operator= (const FSIFluidElement &)=delete
 Broken assignment operator. More...
 
virtual void identify_load_data (std::set< std::pair< Data *, unsigned >> &paired_load_data)=0
 
virtual void identify_pressure_data (std::set< std::pair< Data *, unsigned >> &paired_pressure_data)=0
 
- 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 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
 
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 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 void output (const unsigned &t, std::ostream &outfile, const unsigned &n_plot) const
 
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, 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 Member Functions inherited from oomph::GeneralisedNewtonianTemplateFreeNavierStokesEquationsBase
 GeneralisedNewtonianTemplateFreeNavierStokesEquationsBase ()
 Constructor (empty) More...
 
virtual ~GeneralisedNewtonianTemplateFreeNavierStokesEquationsBase ()
 Virtual destructor (empty) More...
 
virtual int p_local_eqn (const unsigned &n) const =0
 
- Public Member Functions inherited from oomph::NavierStokesElementWithDiagonalMassMatrices
 NavierStokesElementWithDiagonalMassMatrices ()
 Empty constructor. More...
 
virtual ~NavierStokesElementWithDiagonalMassMatrices ()
 Virtual destructor. More...
 
 NavierStokesElementWithDiagonalMassMatrices (const NavierStokesElementWithDiagonalMassMatrices &)=delete
 Broken copy constructor. More...
 
void operator= (const NavierStokesElementWithDiagonalMassMatrices &)=delete
 Broken assignment operator. More...
 

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 double dshape_and_dtest_eulerian_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_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 double dpshape_and_dptest_eulerian_nst (const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const =0
 
virtual void get_body_force_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
 
virtual void get_body_force_gradient_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &d_body_force_dx)
 
virtual double get_source_nst (const double &time, const unsigned &ipt, const Vector< double > &x)
 
virtual void get_source_gradient_nst (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
 
virtual void fill_in_generic_residual_contribution_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
 
virtual void fill_in_generic_dresidual_contribution_nst (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, unsigned flag)
 
void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
- Protected Member Functions inherited from oomph::FiniteElement
virtual void assemble_local_to_eulerian_jacobian (const DShape &dpsids, DenseMatrix< double > &jacobian) const
 
virtual void assemble_local_to_eulerian_jacobian2 (const DShape &d2psids, DenseMatrix< double > &jacobian2) const
 
virtual void assemble_eulerian_base_vectors (const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
 
template<unsigned DIM>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double invert_jacobian_mapping (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual void dJ_eulerian_dnodal_coordinates (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<unsigned DIM>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
virtual void d_dshape_eulerian_dnodal_coordinates (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<unsigned DIM>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
virtual void transform_derivatives (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
void transform_derivatives_diagonal (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
virtual void transform_second_derivatives (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
virtual void fill_in_jacobian_from_nodal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_jacobian_from_nodal_by_fd (DenseMatrix< double > &jacobian)
 
virtual void update_before_nodal_fd ()
 
virtual void reset_after_nodal_fd ()
 
virtual void update_in_nodal_fd (const unsigned &i)
 
virtual void reset_in_nodal_fd (const unsigned &i)
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 Zero-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 One-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 Two-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
- Protected Member Functions inherited from oomph::GeneralisedElement
unsigned add_internal_data (Data *const &data_pt, const bool &fd=true)
 
bool internal_data_fd (const unsigned &i) const
 
void exclude_internal_data_fd (const unsigned &i)
 
void include_internal_data_fd (const unsigned &i)
 
void clear_global_eqn_numbers ()
 
void add_global_eqn_numbers (std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
 
virtual void assign_internal_and_external_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_additional_local_eqn_numbers ()
 
int internal_local_eqn (const unsigned &i, const unsigned &j) const
 
int external_local_eqn (const unsigned &i, const unsigned &j)
 
void fill_in_jacobian_from_internal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_internal_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
virtual void update_before_internal_fd ()
 
virtual void reset_after_internal_fd ()
 
virtual void update_in_internal_fd (const unsigned &i)
 
virtual void reset_in_internal_fd (const unsigned &i)
 
virtual void update_before_external_fd ()
 
virtual void reset_after_external_fd ()
 
virtual void update_in_external_fd (const unsigned &i)
 
virtual void reset_in_external_fd (const unsigned &i)
 
virtual void fill_in_contribution_to_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_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...
 
doubleReInvFr_pt
 
Vector< double > * G_pt
 Pointer to global gravity Vector. More...
 
NavierStokesBodyForceFctPt Body_force_fct_pt
 Pointer to body force function. More...
 
NavierStokesSourceFctPt Source_fct_pt
 Pointer to volumetric source function. More...
 
GeneralisedNewtonianConstitutiveEquation< DIM > * Constitutive_eqn_pt
 Pointer to the generalised Newtonian constitutive equation. More...
 
bool Use_extrapolated_strainrate_to_compute_second_invariant
 
bool ALE_is_disabled
 
- Protected Attributes inherited from oomph::FiniteElement
MacroElementMacro_elem_pt
 Pointer to the element's macro element (NULL by default) More...
 
- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 

Static Protected Attributes

static bool Pre_multiply_by_viscosity_ratio = false
 
- 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
 

Static Private Attributes

static int Pressure_not_stored_at_node = -100
 
static double Default_Physical_Constant_Value = 0.0
 Navier–Stokes equations static data. More...
 
static double Default_Physical_Ratio_Value = 1.0
 Navier–Stokes equations static data. More...
 
static Vector< doubleDefault_Gravity_vector
 Static default value for the gravity vector. More...
 

Detailed Description

template<unsigned DIM>
class oomph::GeneralisedNewtonianNavierStokesEquations< DIM >

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// A class for elements that solve the cartesian Navier–Stokes equations, templated by the dimension DIM. This contains the generic maths – any concrete implementation must be derived from this.

We're solving:

\( { Re \left( St \frac{\partial u_i}{\partial t} + (u_j - u_j^{M}) \frac{\partial u_i}{\partial x_j} \right) = - \frac{\partial p}{\partial x_i} - R_\rho B_i(x_j) - \frac{Re}{Fr} G_i + \frac{\partial }{\partial x_j} \left[ R_\mu \left( \frac{\partial u_i}{\partial x_j} + \frac{\partial u_j}{\partial x_i} \right) \right] } \)

and

\( { \frac{\partial u_i}{\partial x_i} = Q } \)

We also provide all functions required to use this element in FSI problems, by deriving it from the FSIFluidElement base class.

Member Typedef Documentation

◆ NavierStokesBodyForceFctPt

template<unsigned DIM>
typedef void(* oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::NavierStokesBodyForceFctPt) (const double &time, const Vector< double > &x, Vector< double > &body_force)

Function pointer to body force function fct(t,x,f(x)) x is a Vector!

◆ NavierStokesPressureAdvDiffSourceFctPt

template<unsigned DIM>
typedef double(* oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::NavierStokesPressureAdvDiffSourceFctPt) (const Vector< double > &x)

Function pointer to source function fct(x) for the pressure advection diffusion equation (only used during validation!). x is a Vector!

◆ NavierStokesSourceFctPt

template<unsigned DIM>
typedef double(* oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::NavierStokesSourceFctPt) (const double &time, const Vector< double > &x)

Function pointer to source function fct(t,x) x is a Vector!

Constructor & Destructor Documentation

◆ GeneralisedNewtonianNavierStokesEquations()

Constructor: NULL the body force and source function and make sure the ALE terms are included by default.

404  : Body_force_fct_pt(0),
405  Source_fct_pt(0),
406  // Press_adv_diff_source_fct_pt(0),
407  Constitutive_eqn_pt(new NewtonianConstitutiveEquation<DIM>),
409  ALE_is_disabled(false)
410  {
411  // Set all the Physical parameter pointers to the default value zero
416  // Set the Physical ratios to the default value of 1
419  }
static double Default_Physical_Constant_Value
Navier–Stokes equations static data.
Definition: generalised_newtonian_navier_stokes_elements.h:147
double * ReInvFr_pt
Definition: generalised_newtonian_navier_stokes_elements.h:181
double * Viscosity_Ratio_pt
Definition: generalised_newtonian_navier_stokes_elements.h:165
bool Use_extrapolated_strainrate_to_compute_second_invariant
Definition: generalised_newtonian_navier_stokes_elements.h:197
bool ALE_is_disabled
Definition: generalised_newtonian_navier_stokes_elements.h:202
GeneralisedNewtonianConstitutiveEquation< DIM > * Constitutive_eqn_pt
Pointer to the generalised Newtonian constitutive equation.
Definition: generalised_newtonian_navier_stokes_elements.h:193
static Vector< double > Default_Gravity_vector
Static default value for the gravity vector.
Definition: generalised_newtonian_navier_stokes_elements.h:154
double * Density_Ratio_pt
Definition: generalised_newtonian_navier_stokes_elements.h:169
static double Default_Physical_Ratio_Value
Navier–Stokes equations static data.
Definition: generalised_newtonian_navier_stokes_elements.h:151
NavierStokesBodyForceFctPt Body_force_fct_pt
Pointer to body force function.
Definition: generalised_newtonian_navier_stokes_elements.h:187
NavierStokesSourceFctPt Source_fct_pt
Pointer to volumetric source function.
Definition: generalised_newtonian_navier_stokes_elements.h:190
double * Re_pt
Pointer to global Reynolds number.
Definition: generalised_newtonian_navier_stokes_elements.h:174
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
Definition: generalised_newtonian_navier_stokes_elements.h:177
Vector< double > * G_pt
Pointer to global gravity Vector.
Definition: generalised_newtonian_navier_stokes_elements.h:184

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Default_Gravity_vector, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Default_Physical_Constant_Value, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Default_Physical_Ratio_Value, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Density_Ratio_pt, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::G_pt, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Re_pt, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ReInvFr_pt, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ReSt_pt, and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Viscosity_Ratio_pt.

Member Function Documentation

◆ body_force_fct_pt() [1/2]

template<unsigned DIM>
NavierStokesBodyForceFctPt& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::body_force_fct_pt ( )
inline

Access function for the body-force pointer.

505  {
506  return Body_force_fct_pt;
507  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Body_force_fct_pt.

◆ body_force_fct_pt() [2/2]

template<unsigned DIM>
NavierStokesBodyForceFctPt oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::body_force_fct_pt ( ) const
inline

Access function for the body-force pointer. Const version.

511  {
512  return Body_force_fct_pt;
513  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Body_force_fct_pt.

◆ compute_error() [1/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::compute_error ( std::ostream &  outfile,
FiniteElement::SteadyExactSolutionFctPt  exact_soln_pt,
double error,
double norm 
)
virtual

Validate against exact solution. Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element

Validate against exact velocity solution Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element.

Reimplemented from oomph::FiniteElement.

284  {
285  error = 0.0;
286  norm = 0.0;
287 
288  // Vector of local coordinates
289  Vector<double> s(DIM);
290 
291  // Vector for coordintes
292  Vector<double> x(DIM);
293 
294  // Set the value of n_intpt
295  unsigned n_intpt = integral_pt()->nweight();
296 
297 
298  outfile << "ZONE" << std::endl;
299 
300  // Exact solution Vector (u,v,[w],p)
301  Vector<double> exact_soln(DIM + 1);
302 
303  // Loop over the integration points
304  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
305  {
306  // Assign values of s
307  for (unsigned i = 0; i < DIM; i++)
308  {
309  s[i] = integral_pt()->knot(ipt, i);
310  }
311 
312  // Get the integral weight
313  double w = integral_pt()->weight(ipt);
314 
315  // Get jacobian of mapping
316  double J = J_eulerian(s);
317 
318  // Premultiply the weights and the Jacobian
319  double W = w * J;
320 
321  // Get x position as Vector
322  interpolated_x(s, x);
323 
324  // Get exact solution at this point
325  (*exact_soln_pt)(x, exact_soln);
326 
327  // Velocity error
328  for (unsigned i = 0; i < DIM; i++)
329  {
330  norm += exact_soln[i] * exact_soln[i] * W;
331  error += (exact_soln[i] - interpolated_u_nst(s, i)) *
332  (exact_soln[i] - interpolated_u_nst(s, i)) * W;
333  }
334 
335  // Output x,y,...,u_exact
336  for (unsigned i = 0; i < DIM; i++)
337  {
338  outfile << x[i] << " ";
339  }
340 
341  // Output x,y,[z],u_error,v_error,[w_error]
342  for (unsigned i = 0; i < DIM; i++)
343  {
344  outfile << exact_soln[i] - interpolated_u_nst(s, i) << " ";
345  }
346  outfile << std::endl;
347  }
348  }
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
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
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
virtual double J_eulerian(const Vector< double > &s) const
Definition: elements.cc:4103
void interpolated_u_nst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
Definition: generalised_newtonian_navier_stokes_elements.h:1093
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.
RealScalar s
Definition: level1_cplx_impl.h:130
#define DIM
Definition: linearised_navier_stokes_elements.h:44
void exact_soln(const double &time, const Vector< double > &x, Vector< double > &soln)
Definition: unstructured_two_d_curved.cc:301
int error
Definition: calibrate.py:297
@ W
Definition: quadtree.h:63
list x
Definition: plotDoE.py:28

References DIM, calibrate::error, ProblemParameters::exact_soln(), i, J, s, w, oomph::QuadTreeNames::W, and plotDoE::x.

◆ compute_error() [2/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::compute_error ( std::ostream &  outfile,
FiniteElement::UnsteadyExactSolutionFctPt  exact_soln_pt,
const double time,
double error,
double norm 
)
virtual

Validate against exact solution at given time Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element

Validate against exact velocity solution at given time. Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element.

Reimplemented from oomph::FiniteElement.

206  {
207  error = 0.0;
208  norm = 0.0;
209 
210  // Vector of local coordinates
211  Vector<double> s(DIM);
212 
213  // Vector for coordintes
214  Vector<double> x(DIM);
215 
216  // Set the value of n_intpt
217  unsigned n_intpt = integral_pt()->nweight();
218 
219  outfile << "ZONE" << std::endl;
220 
221  // Exact solution Vector (u,v,[w],p)
222  Vector<double> exact_soln(DIM + 1);
223 
224  // Loop over the integration points
225  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
226  {
227  // Assign values of s
228  for (unsigned i = 0; i < DIM; i++)
229  {
230  s[i] = integral_pt()->knot(ipt, i);
231  }
232 
233  // Get the integral weight
234  double w = integral_pt()->weight(ipt);
235 
236  // Get jacobian of mapping
237  double J = J_eulerian(s);
238 
239  // Premultiply the weights and the Jacobian
240  double W = w * J;
241 
242  // Get x position as Vector
243  interpolated_x(s, x);
244 
245  // Get exact solution at this point
246  (*exact_soln_pt)(time, x, exact_soln);
247 
248  // Velocity error
249  for (unsigned i = 0; i < DIM; i++)
250  {
251  norm += exact_soln[i] * exact_soln[i] * W;
252  error += (exact_soln[i] - interpolated_u_nst(s, i)) *
253  (exact_soln[i] - interpolated_u_nst(s, i)) * W;
254  }
255 
256  // Output x,y,...,u_exact
257  for (unsigned i = 0; i < DIM; i++)
258  {
259  outfile << x[i] << " ";
260  }
261 
262  // Output x,y,[z],u_error,v_error,[w_error]
263  for (unsigned i = 0; i < DIM; i++)
264  {
265  outfile << exact_soln[i] - interpolated_u_nst(s, i) << " ";
266  }
267 
268  outfile << std::endl;
269  }
270  }

References DIM, calibrate::error, ProblemParameters::exact_soln(), i, J, s, w, oomph::QuadTreeNames::W, and plotDoE::x.

◆ constitutive_eqn_pt()

template<unsigned DIM>
GeneralisedNewtonianConstitutiveEquation<DIM>*& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::constitutive_eqn_pt ( )
inline

Access function for the constitutive equation pointer.

529  {
530  return Constitutive_eqn_pt;
531  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Constitutive_eqn_pt.

◆ d_kin_energy_dt()

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::d_kin_energy_dt

Get integral of time derivative of kinetic energy over element.

Get integral of time derivative of kinetic energy over element:

1416  {
1417  // Initialise
1418  double d_kin_en_dt = 0.0;
1419 
1420  // Set the value of n_intpt
1421  const unsigned n_intpt = integral_pt()->nweight();
1422 
1423  // Set the Vector to hold local coordinates
1424  Vector<double> s(DIM);
1425 
1426  // Get the number of nodes
1427  const unsigned n_node = this->nnode();
1428 
1429  // Storage for the shape function
1430  Shape psi(n_node);
1431  DShape dpsidx(n_node, DIM);
1432 
1433  // Get the value at which the velocities are stored
1434  unsigned u_index[DIM];
1435  for (unsigned i = 0; i < DIM; i++)
1436  {
1437  u_index[i] = this->u_index_nst(i);
1438  }
1439 
1440  // Loop over the integration points
1441  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
1442  {
1443  // Get the jacobian of the mapping
1444  double J = dshape_eulerian_at_knot(ipt, psi, dpsidx);
1445 
1446  // Get the integral weight
1447  double w = integral_pt()->weight(ipt);
1448 
1449  // Now work out the velocity and the time derivative
1450  Vector<double> interpolated_u(DIM, 0.0), interpolated_dudt(DIM, 0.0);
1451 
1452  // Loop over the shape functions
1453  for (unsigned l = 0; l < n_node; l++)
1454  {
1455  // Loop over the dimensions
1456  for (unsigned i = 0; i < DIM; i++)
1457  {
1458  interpolated_u[i] += nodal_value(l, u_index[i]) * psi(l);
1459  interpolated_dudt[i] += du_dt_nst(l, u_index[i]) * psi(l);
1460  }
1461  }
1462 
1463  // Get mesh velocity bit
1464  if (!ALE_is_disabled)
1465  {
1466  Vector<double> mesh_velocity(DIM, 0.0);
1467  DenseMatrix<double> interpolated_dudx(DIM, DIM, 0.0);
1468 
1469  // Loop over nodes again
1470  for (unsigned l = 0; l < n_node; l++)
1471  {
1472  for (unsigned i = 0; i < DIM; i++)
1473  {
1474  mesh_velocity[i] += this->dnodal_position_dt(l, i) * psi(l);
1475 
1476  for (unsigned j = 0; j < DIM; j++)
1477  {
1478  interpolated_dudx(i, j) +=
1479  this->nodal_value(l, u_index[i]) * dpsidx(l, j);
1480  }
1481  }
1482  }
1483 
1484  // Subtract mesh velocity from du_dt
1485  for (unsigned i = 0; i < DIM; i++)
1486  {
1487  for (unsigned k = 0; k < DIM; k++)
1488  {
1489  interpolated_dudt[i] -= mesh_velocity[k] * interpolated_dudx(i, k);
1490  }
1491  }
1492  }
1493 
1494 
1495  // Loop over directions and add up u du/dt terms
1496  double sum = 0.0;
1497  for (unsigned i = 0; i < DIM; i++)
1498  {
1499  sum += interpolated_u[i] * interpolated_dudt[i];
1500  }
1501 
1502  d_kin_en_dt += sum * w * J;
1503  }
1504 
1505  return d_kin_en_dt;
1506  }
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3325
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 unsigned u_index_nst(const unsigned &i) const
Definition: generalised_newtonian_navier_stokes_elements.h:580
double du_dt_nst(const unsigned &n, const unsigned &i) const
Definition: generalised_newtonian_navier_stokes_elements.h:594
char char char int int * k
Definition: level2_impl.h:374
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::ALE_is_disabled, DIM, i, J, j, k, s, and w.

◆ density_ratio()

template<unsigned DIM>
const double& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::density_ratio ( ) const
inline

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

469  {
470  return *Density_Ratio_pt;
471  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Density_Ratio_pt.

◆ density_ratio_pt()

template<unsigned DIM>
double*& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::density_ratio_pt ( )
inline

Pointer to Density ratio.

475  {
476  return Density_Ratio_pt;
477  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Density_Ratio_pt.

◆ dinterpolated_u_nst_ddata()

template<unsigned DIM>
virtual void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::dinterpolated_u_nst_ddata ( const Vector< double > &  s,
const unsigned i,
Vector< double > &  du_ddata,
Vector< unsigned > &  global_eqn_number 
)
inlinevirtual

Compute the derivatives of the i-th component of velocity at point s with respect to all data that can affect its value. In addition, return the global equation numbers corresponding to the data. The function is virtual so that it can be overloaded in the refineable version

Reimplemented in oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >.

1179  {
1180  // Find number of nodes
1181  unsigned n_node = nnode();
1182  // Local shape function
1183  Shape psi(n_node);
1184  // Find values of shape function
1185  shape(s, psi);
1186 
1187  // Find the index at which the velocity component is stored
1188  const unsigned u_nodal_index = u_index_nst(i);
1189 
1190  // Find the number of dofs associated with interpolated u
1191  unsigned n_u_dof = 0;
1192  for (unsigned l = 0; l < n_node; l++)
1193  {
1194  int global_eqn = this->node_pt(l)->eqn_number(u_nodal_index);
1195  // If it's positive add to the count
1196  if (global_eqn >= 0)
1197  {
1198  ++n_u_dof;
1199  }
1200  }
1201 
1202  // Now resize the storage schemes
1203  du_ddata.resize(n_u_dof, 0.0);
1204  global_eqn_number.resize(n_u_dof, 0);
1205 
1206  // Loop over th nodes again and set the derivatives
1207  unsigned count = 0;
1208  // Loop over the local nodes and sum
1209  for (unsigned l = 0; l < n_node; l++)
1210  {
1211  // Get the global equation number
1212  int global_eqn = this->node_pt(l)->eqn_number(u_nodal_index);
1213  if (global_eqn >= 0)
1214  {
1215  // Set the global equation number
1216  global_eqn_number[count] = global_eqn;
1217  // Set the derivative with respect to the unknown
1218  du_ddata[count] = psi[l];
1219  // Increase the counter
1220  ++count;
1221  }
1222  }
1223  }
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
Definition: nodes.h:367
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
virtual void shape(const Vector< double > &s, Shape &psi) const =0

References oomph::Data::eqn_number(), i, oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), s, oomph::FiniteElement::shape(), and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_index_nst().

◆ disable_ALE()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::disable_ALE ( )
inlinevirtual

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

Reimplemented from oomph::FiniteElement.

624  {
625  ALE_is_disabled = true;
626  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ALE_is_disabled.

◆ dissipation() [1/2]

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::dissipation

Return integral of dissipation over element.

831  {
832  throw OomphLibError(
833  "Check the dissipation calculation for GeneralisedNewtonian NSt",
836 
837  // Initialise
838  double diss = 0.0;
839 
840  // Set the value of n_intpt
841  unsigned n_intpt = integral_pt()->nweight();
842 
843  // Set the Vector to hold local coordinates
844  Vector<double> s(DIM);
845 
846  // Loop over the integration points
847  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
848  {
849  // Assign values of s
850  for (unsigned i = 0; i < DIM; i++)
851  {
852  s[i] = integral_pt()->knot(ipt, i);
853  }
854 
855  // Get the integral weight
856  double w = integral_pt()->weight(ipt);
857 
858  // Get Jacobian of mapping
859  double J = J_eulerian(s);
860 
861  // Get strain rate matrix
862  DenseMatrix<double> strainrate(DIM, DIM);
863  strain_rate(s, strainrate);
864 
865  // Initialise
866  double local_diss = 0.0;
867  for (unsigned i = 0; i < DIM; i++)
868  {
869  for (unsigned j = 0; j < DIM; j++)
870  {
871  local_diss += 2.0 * strainrate(i, j) * strainrate(i, j);
872  }
873  }
874 
875  diss += local_diss * w * J;
876  }
877 
878  return diss;
879  }
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i)
Definition: generalised_newtonian_navier_stokes_elements.cc:1012
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References DIM, i, J, j, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, and w.

◆ dissipation() [2/2]

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::dissipation ( const Vector< double > &  s) const

Return dissipation at local coordinate s.

985  {
986  throw OomphLibError(
987  "Check the dissipation calculation for GeneralisedNewtonian NSt",
990 
991  // Get strain rate matrix
992  DenseMatrix<double> strainrate(DIM, DIM);
993  strain_rate(s, strainrate);
994 
995  // Initialise
996  double local_diss = 0.0;
997  for (unsigned i = 0; i < DIM; i++)
998  {
999  for (unsigned j = 0; j < DIM; j++)
1000  {
1001  local_diss += 2.0 * strainrate(i, j) * strainrate(i, j);
1002  }
1003  }
1004 
1005  return local_diss;
1006  }

References DIM, i, j, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and s.

◆ dpshape_and_dptest_eulerian_nst()

◆ dshape_and_dtest_eulerian_at_knot_nst() [1/2]

template<unsigned DIM>
virtual double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::dshape_and_dtest_eulerian_at_knot_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

◆ dshape_and_dtest_eulerian_at_knot_nst() [2/2]

template<unsigned DIM>
virtual double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::dshape_and_dtest_eulerian_at_knot_nst ( const unsigned ipt,
Shape psi,
DShape dpsidx,
Shape test,
DShape dtestdx 
) const
protectedpure virtual

◆ dshape_and_dtest_eulerian_nst()

template<unsigned DIM>
virtual double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::dshape_and_dtest_eulerian_nst ( const Vector< double > &  s,
Shape psi,
DShape dpsidx,
Shape test,
DShape dtestdx 
) const
protectedpure virtual

◆ du_dt_nst()

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::du_dt_nst ( const unsigned n,
const unsigned i 
) const
inline

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

595  {
596  // Get the data's timestepper
597  TimeStepper* time_stepper_pt = this->node_pt(n)->time_stepper_pt();
598 
599  // Initialise dudt
600  double dudt = 0.0;
601 
602  // Loop over the timesteps, if there is a non Steady timestepper
603  if (!time_stepper_pt->is_steady())
604  {
605  // Find the index at which the dof is stored
606  const unsigned u_nodal_index = this->u_index_nst(i);
607 
608  // Number of timsteps (past & present)
609  const unsigned n_time = time_stepper_pt->ntstorage();
610  // Loop over the timesteps
611  for (unsigned t = 0; t < n_time; t++)
612  {
613  dudt +=
614  time_stepper_pt->weight(1, t) * nodal_value(t, n, u_nodal_index);
615  }
616  }
617 
618  return dudt;
619  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
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 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(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_index_nst(), and oomph::TimeStepper::weight().

◆ enable_ALE()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::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.

633  {
634  ALE_is_disabled = false;
635  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ALE_is_disabled.

◆ extrapolated_strain_rate() [1/2]

template<unsigned DIM>
virtual void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::extrapolated_strain_rate ( const unsigned ipt,
DenseMatrix< double > &  strain_rate 
) const
inlinevirtual

Extrapolated strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) based on the previous time steps evaluated at ipt-th integration point

702  {
703  // Set the Vector to hold local coordinates
704  Vector<double> s(DIM);
705  for (unsigned i = 0; i < DIM; i++) s[i] = integral_pt()->knot(ipt, i);
707  }
virtual void extrapolated_strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Definition: generalised_newtonian_navier_stokes_elements.cc:1175

References DIM, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::extrapolated_strain_rate(), i, oomph::FiniteElement::integral_pt(), oomph::Integral::knot(), s, and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::strain_rate().

◆ extrapolated_strain_rate() [2/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::extrapolated_strain_rate ( const Vector< double > &  s,
DenseMatrix< double > &  strainrate 
) const
virtual

Extrapolated strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) based on the previous time steps evaluated at local coordinate s

Get strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) Extrapolated from history values.

1177  {
1178 #ifdef PARANOID
1179  if ((strainrate.ncol() != DIM) || (strainrate.nrow() != DIM))
1180  {
1181  std::ostringstream error_message;
1182  error_message << "The strain rate has incorrect dimensions "
1183  << strainrate.ncol() << " x " << strainrate.nrow()
1184  << " Not " << DIM << std::endl;
1185 
1186  throw OomphLibError(
1187  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1188  }
1189 #endif
1190 
1191  // Get strain rates at two previous times
1192  DenseMatrix<double> strain_rate_minus_two(DIM, DIM);
1193  strain_rate(2, s, strain_rate_minus_two);
1194 
1195  DenseMatrix<double> strain_rate_minus_one(DIM, DIM);
1196  strain_rate(1, s, strain_rate_minus_one);
1197 
1198  // Get timestepper from first node
1199  TimeStepper* time_stepper_pt = node_pt(0)->time_stepper_pt();
1200 
1201  // Current and previous timesteps
1202  double dt_current = time_stepper_pt->time_pt()->dt(0);
1203  double dt_prev = time_stepper_pt->time_pt()->dt(1);
1204 
1205  // Extrapolate
1206  for (unsigned i = 0; i < DIM; i++)
1207  {
1208  for (unsigned j = 0; j < DIM; j++)
1209  {
1210  // Rate of changed based on previous two solutions
1211  double slope =
1212  (strain_rate_minus_one(i, j) - strain_rate_minus_two(i, j)) / dt_prev;
1213 
1214  // Extrapolated value from previous computed one to current one
1215  strainrate(i, j) = strain_rate_minus_one(i, j) + slope * dt_current;
1216  }
1217  }
1218  }
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
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
double & dt(const unsigned &t=0)
Definition: timesteppers.h:136

References DIM, oomph::Time::dt(), i, j, oomph::DenseMatrix< T >::ncol(), oomph::DenseMatrix< T >::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, and oomph::TimeStepper::time_pt().

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::extrapolated_strain_rate().

◆ fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::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 
)
inlinevirtual

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

Reimplemented from oomph::GeneralisedElement.

993  {
994  // Call the generic routine with the flag set to 2
996  parameter_pt, dres_dparam, djac_dparam, dmass_matrix_dparam, 2);
997  }
virtual void fill_in_generic_dresidual_contribution_nst(double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, unsigned flag)
Definition: generalised_newtonian_navier_stokes_elements.cc:2094

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_dresidual_contribution_nst().

◆ fill_in_contribution_to_djacobian_dparameter()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_djacobian_dparameter ( double *const &  parameter_pt,
Vector< double > &  dres_dparam,
DenseMatrix< double > &  djac_dparam 
)
inlinevirtual

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

Reimplemented from oomph::GeneralisedElement.

976  {
977  // Call the generic routine with the flag set to 1
979  parameter_pt,
980  dres_dparam,
981  djac_dparam,
983  1);
984  }
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227

References oomph::GeneralisedElement::Dummy_matrix, and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_dresidual_contribution_nst().

◆ fill_in_contribution_to_dresiduals_dparameter()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_dresiduals_dparameter ( double *const &  parameter_pt,
Vector< double > &  dres_dparam 
)
inlinevirtual

Compute the element's residual Vector.

Reimplemented from oomph::GeneralisedElement.

959  {
960  // Call the generic residuals function with flag set to 0
961  // and using a dummy matrix argument
963  parameter_pt,
964  dres_dparam,
967  0);
968  }

References oomph::GeneralisedElement::Dummy_matrix, and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_dresidual_contribution_nst().

◆ fill_in_contribution_to_hessian_vector_products()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_hessian_vector_products ( Vector< double > const &  Y,
DenseMatrix< double > const &  C,
DenseMatrix< double > &  product 
)
protectedvirtual

Compute the hessian tensor vector products required to perform continuation of bifurcations analytically

Reimplemented from oomph::GeneralisedElement.

2116  {
2117  throw OomphLibError("Not yet implemented\n",
2120  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ fill_in_contribution_to_jacobian()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::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 oomph::PseudoSolidNodeUpdateElement< GeneralisedNewtonianTTaylorHoodElement< 2 >, TPVDElement< 2, 3 > >.

936  {
937  // Call the generic routine with the flag set to 1
939  residuals, jacobian, GeneralisedElement::Dummy_matrix, 1);
940  // obacht FD version
941  // FiniteElement::fill_in_contribution_to_jacobian(residuals,jacobian);
942  }
virtual void fill_in_generic_residual_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Definition: generalised_newtonian_navier_stokes_elements.cc:1608

References oomph::GeneralisedElement::Dummy_matrix, and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst().

◆ fill_in_contribution_to_jacobian_and_mass_matrix()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::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.

Reimplemented in oomph::PseudoSolidNodeUpdateElement< GeneralisedNewtonianTTaylorHoodElement< 2 >, TPVDElement< 2, 3 > >.

950  {
951  // Call the generic routine with the flag set to 2
953  residuals, jacobian, mass_matrix, 2);
954  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst().

◆ fill_in_contribution_to_residuals()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inlinevirtual

Compute the element's residual Vector.

Reimplemented from oomph::GeneralisedElement.

Reimplemented in oomph::PseudoSolidNodeUpdateElement< GeneralisedNewtonianTTaylorHoodElement< 2 >, TPVDElement< 2, 3 > >.

922  {
923  // Call the generic residuals function with flag set to 0
924  // and using a dummy matrix argument
926  residuals,
929  0);
930  }

References oomph::GeneralisedElement::Dummy_matrix, and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst().

◆ fill_in_generic_dresidual_contribution_nst()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_dresidual_contribution_nst ( double *const &  parameter_pt,
Vector< double > &  dres_dparam,
DenseMatrix< double > &  djac_dparam,
DenseMatrix< double > &  dmass_matrix_dparam,
unsigned  flag 
)
protectedvirtual

Compute the derivatives of the residuals for the Navier–Stokes equations with respect to a parameter Flag=1 (or 0): do (or don't) compute the Jacobian as well. Flag=2: Fill in mass matrix too.

Compute the derivatives of the residuals for the Navier–Stokes equations with respect to a parameter; flag=2 or 1 or 0: do (or don't) compute the Jacobian and mass matrix as well

2100  {
2101  throw OomphLibError("Not yet implemented\n",
2104  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_djacobian_dparameter(), and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_dresiduals_dparameter().

◆ fill_in_generic_residual_contribution_nst()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_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. Flag=2: Fill in mass matrix too.

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

Reimplemented in oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >.

1612  {
1613  // Return immediately if there are no dofs
1614  if (ndof() == 0) return;
1615 
1616  // Find out how many nodes there are
1617  unsigned n_node = nnode();
1618 
1619  // Get continuous time from timestepper of first node
1620  double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
1621 
1622  // Find out how many pressure dofs there are
1623  unsigned n_pres = npres_nst();
1624 
1625  // Find the indices at which the local velocities are stored
1626  unsigned u_nodal_index[DIM];
1627  for (unsigned i = 0; i < DIM; i++)
1628  {
1629  u_nodal_index[i] = u_index_nst(i);
1630  }
1631 
1632  // Set up memory for the shape and test functions
1633  Shape psif(n_node), testf(n_node);
1634  DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
1635 
1636  // Set up memory for pressure shape and test functions
1637  Shape psip(n_pres), testp(n_pres);
1638 
1639  // Number of integration points
1640  unsigned n_intpt = integral_pt()->nweight();
1641 
1642  // Set the Vector to hold local coordinates
1643  Vector<double> s(DIM);
1644 
1645  // Get Physical Variables from Element
1646  // Reynolds number must be multiplied by the density ratio
1647  double scaled_re = re() * density_ratio();
1648  double scaled_re_st = re_st() * density_ratio();
1649  double scaled_re_inv_fr = re_invfr() * density_ratio();
1650  double visc_ratio = viscosity_ratio();
1651  Vector<double> G = g();
1652 
1653  // Integers to store the local equations and unknowns
1654  int local_eqn = 0, local_unknown = 0;
1655 
1656  // Loop over the integration points
1657  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
1658  {
1659  // Assign values of s
1660  for (unsigned i = 0; i < DIM; i++) s[i] = integral_pt()->knot(ipt, i);
1661  // Get the integral weight
1662  double w = integral_pt()->weight(ipt);
1663 
1664  // Call the derivatives of the shape and test functions
1666  ipt, psif, dpsifdx, testf, dtestfdx);
1667 
1668  // Call the pressure shape and test functions
1669  pshape_nst(s, psip, testp);
1670 
1671  // Premultiply the weights and the Jacobian
1672  double W = w * J;
1673 
1674  // Calculate local values of the pressure and velocity components
1675  // Allocate
1676  double interpolated_p = 0.0;
1677  Vector<double> interpolated_u(DIM, 0.0);
1678  Vector<double> interpolated_x(DIM, 0.0);
1679  Vector<double> mesh_velocity(DIM, 0.0);
1680  Vector<double> dudt(DIM, 0.0);
1681  DenseMatrix<double> interpolated_dudx(DIM, DIM, 0.0);
1682 
1683  // Calculate pressure
1684  for (unsigned l = 0; l < n_pres; l++)
1685  interpolated_p += p_nst(l) * psip[l];
1686 
1687  // Calculate velocities and derivatives:
1688 
1689  // Loop over nodes
1690  for (unsigned l = 0; l < n_node; l++)
1691  {
1692  // Loop over directions
1693  for (unsigned i = 0; i < DIM; i++)
1694  {
1695  // Get the nodal value
1696  double u_value = raw_nodal_value(l, u_nodal_index[i]);
1697  interpolated_u[i] += u_value * psif[l];
1698  interpolated_x[i] += raw_nodal_position(l, i) * psif[l];
1699  dudt[i] += du_dt_nst(l, i) * psif[l];
1700 
1701  // Loop over derivative directions
1702  for (unsigned j = 0; j < DIM; j++)
1703  {
1704  interpolated_dudx(i, j) += u_value * dpsifdx(l, j);
1705  }
1706  }
1707  }
1708 
1709  if (!ALE_is_disabled)
1710  {
1711  // Loop over nodes
1712  for (unsigned l = 0; l < n_node; l++)
1713  {
1714  // Loop over directions
1715  for (unsigned i = 0; i < DIM; i++)
1716  {
1717  mesh_velocity[i] += this->raw_dnodal_position_dt(l, i) * psif[l];
1718  }
1719  }
1720  }
1721 
1722  // The strainrate used to compute the second invariant
1723  DenseMatrix<double> strainrate_to_compute_second_invariant(DIM, DIM, 0.0);
1724 
1725  // the strainrate used to calculate the second invariant
1726  // can be either the current one or the one extrapolated from
1727  // previous velocity values
1729  {
1730  strain_rate(s, strainrate_to_compute_second_invariant);
1731  }
1732  else
1733  {
1734  extrapolated_strain_rate(ipt, strainrate_to_compute_second_invariant);
1735  }
1736 
1737  // Calculate the second invariant
1739  strainrate_to_compute_second_invariant);
1740 
1741  // Get the viscosity according to the constitutive equation
1742  double viscosity = Constitutive_eqn_pt->viscosity(second_invariant);
1743 
1744  // Get the user-defined body force terms
1745  Vector<double> body_force(DIM);
1747 
1748  // Get the user-defined source function
1749  double source = get_source_nst(time, ipt, interpolated_x);
1750 
1751  // The generalised Newtonian viscosity differentiated w.r.t.
1752  // the unknown velocities
1753  DenseMatrix<double> dviscosity_dunknown(DIM, n_node, 0.0);
1754 
1756  {
1757  // Calculate the derivate of the viscosity w.r.t. the second invariant
1758  double dviscosity_dsecond_invariant =
1759  Constitutive_eqn_pt->dviscosity_dinvariant(second_invariant);
1760 
1761  // calculate the strainrate
1762  DenseMatrix<double> strainrate(DIM, DIM, 0.0);
1763  strain_rate(s, strainrate);
1764 
1765  // pre-compute the derivative of the second invariant w.r.t. the
1766  // entries in the rate of strain tensor
1767  DenseMatrix<double> dinvariant_dstrainrate(DIM, DIM, 0.0);
1768 
1769  // setting up a Kronecker Delta matrix, which has ones at the diagonal
1770  // and zeros off-diagonally
1771  DenseMatrix<double> kroneckerdelta(DIM, DIM, 0.0);
1772 
1773  for (unsigned i = 0; i < DIM; i++)
1774  {
1775  for (unsigned j = 0; j < DIM; j++)
1776  {
1777  if (i == j)
1778  {
1779  // Set the diagonal entries of the Kronecker delta
1780  kroneckerdelta(i, i) = 1.0;
1781 
1782  double tmp = 0.0;
1783  for (unsigned k = 0; k < DIM; k++)
1784  {
1785  if (k != i)
1786  {
1787  tmp += strainrate(k, k);
1788  }
1789  }
1790  dinvariant_dstrainrate(i, i) = tmp;
1791  }
1792  else
1793  {
1794  dinvariant_dstrainrate(i, j) = -strainrate(j, i);
1795  }
1796  }
1797  }
1798 
1799  // a rank four tensor storing the derivative of the strainrate
1800  // w.r.t. the unknowns
1801  RankFourTensor<double> dstrainrate_dunknown(DIM, DIM, DIM, n_node);
1802 
1803  // loop over the nodes
1804  for (unsigned l = 0; l < n_node; l++)
1805  {
1806  // loop over the velocity components
1807  for (unsigned k = 0; k < DIM; k++)
1808  {
1809  // loop over the entries of the rate of strain tensor
1810  for (unsigned i = 0; i < DIM; i++)
1811  {
1812  for (unsigned j = 0; j < DIM; j++)
1813  {
1814  // initialise the entry to zero
1815  dstrainrate_dunknown(i, j, k, l) = 0.0;
1816 
1817  // loop over velocities and directions
1818  for (unsigned m = 0; m < DIM; m++)
1819  {
1820  for (unsigned n = 0; n < DIM; n++)
1821  {
1822  dstrainrate_dunknown(i, j, k, l) +=
1823  0.5 *
1824  (kroneckerdelta(i, m) * kroneckerdelta(j, n) +
1825  kroneckerdelta(i, n) * kroneckerdelta(j, m)) *
1826  kroneckerdelta(m, k) * dpsifdx(l, n);
1827  }
1828  }
1829  }
1830  }
1831  }
1832  }
1833 
1834  // Now calculate the derivative of the viscosity w.r.t. the unknowns
1835  // loop over the nodes
1836  for (unsigned l = 0; l < n_node; l++)
1837  {
1838  // loop over the velocities
1839  for (unsigned k = 0; k < DIM; k++)
1840  {
1841  // loop over the entries in the rate of strain tensor
1842  for (unsigned i = 0; i < DIM; i++)
1843  {
1844  for (unsigned j = 0; j < DIM; j++)
1845  {
1846  dviscosity_dunknown(k, l) += dviscosity_dsecond_invariant *
1847  dinvariant_dstrainrate(i, j) *
1848  dstrainrate_dunknown(i, j, k, l);
1849  }
1850  }
1851  }
1852  }
1853  }
1854 
1855 
1856  // MOMENTUM EQUATIONS
1857  //------------------
1858 
1859  // Loop over the test functions
1860  for (unsigned l = 0; l < n_node; l++)
1861  {
1862  // Loop over the velocity components
1863  for (unsigned i = 0; i < DIM; i++)
1864  {
1865  /*IF it's not a boundary condition*/
1866  local_eqn = nodal_local_eqn(l, u_nodal_index[i]);
1867  if (local_eqn >= 0)
1868  {
1869  // Add the user-defined body force terms
1870  residuals[local_eqn] += body_force[i] * testf[l] * W;
1871 
1872  // Add the gravitational body force term
1873  residuals[local_eqn] += scaled_re_inv_fr * testf[l] * G[i] * W;
1874 
1875  // Add the pressure gradient term
1876  // Potentially pre-multiply by viscosity ratio
1878  {
1879  residuals[local_eqn] +=
1880  visc_ratio * viscosity * interpolated_p * dtestfdx(l, i) * W;
1881  }
1882  else
1883  {
1884  residuals[local_eqn] += interpolated_p * dtestfdx(l, i) * W;
1885  }
1886 
1887  // Add in the stress tensor terms
1888  // The viscosity ratio needs to go in here to ensure
1889  // continuity of normal stress is satisfied even in flows
1890  // with zero pressure gradient!
1891  for (unsigned k = 0; k < DIM; k++)
1892  {
1893  residuals[local_eqn] -=
1894  visc_ratio * viscosity *
1895  (interpolated_dudx(i, k) + Gamma[i] * interpolated_dudx(k, i)) *
1896  dtestfdx(l, k) * W;
1897  }
1898 
1899  // Add in the inertial terms
1900  // du/dt term
1901  residuals[local_eqn] -= scaled_re_st * dudt[i] * testf[l] * W;
1902 
1903 
1904  // Convective terms, including mesh velocity
1905  for (unsigned k = 0; k < DIM; k++)
1906  {
1907  double tmp = scaled_re * interpolated_u[k];
1908  if (!ALE_is_disabled) tmp -= scaled_re_st * mesh_velocity[k];
1909  residuals[local_eqn] -=
1910  tmp * interpolated_dudx(i, k) * testf[l] * W;
1911  }
1912 
1913  // CALCULATE THE JACOBIAN
1914  if (flag)
1915  {
1916  // Loop over the velocity shape functions again
1917  for (unsigned l2 = 0; l2 < n_node; l2++)
1918  {
1919  // Loop over the velocity components again
1920  for (unsigned i2 = 0; i2 < DIM; i2++)
1921  {
1922  // If at a non-zero degree of freedom add in the entry
1923  local_unknown = nodal_local_eqn(l2, u_nodal_index[i2]);
1924  if (local_unknown >= 0)
1925  {
1926  // Add contribution to Elemental Matrix
1927  jacobian(local_eqn, local_unknown) -=
1928  visc_ratio * viscosity * Gamma[i] * dpsifdx(l2, i) *
1929  dtestfdx(l, i2) * W;
1930 
1931  // Extra component if i2 = i
1932  if (i2 == i)
1933  {
1934  /*Loop over velocity components*/
1935  for (unsigned k = 0; k < DIM; k++)
1936  {
1937  jacobian(local_eqn, local_unknown) -=
1938  visc_ratio * viscosity * dpsifdx(l2, k) *
1939  dtestfdx(l, k) * W;
1940  }
1941  }
1942 
1943  if (
1945  {
1946  for (unsigned k = 0; k < DIM; k++)
1947  {
1948  jacobian(local_eqn, local_unknown) -=
1949  visc_ratio * dviscosity_dunknown(i2, l2) *
1950  (interpolated_dudx(i, k) +
1951  Gamma[i] * interpolated_dudx(k, i)) *
1952  dtestfdx(l, k) * W;
1953  }
1954  }
1955 
1956  // Now add in the inertial terms
1957  jacobian(local_eqn, local_unknown) -=
1958  scaled_re * psif[l2] * interpolated_dudx(i, i2) *
1959  testf[l] * W;
1960 
1961  // Extra component if i2=i
1962  if (i2 == i)
1963  {
1964  // Add the mass matrix term (only diagonal entries)
1965  // Note that this is positive because the mass matrix
1966  // is taken to the other side of the equation when
1967  // formulating the generalised eigenproblem.
1968  if (flag == 2)
1969  {
1970  mass_matrix(local_eqn, local_unknown) +=
1971  scaled_re_st * psif[l2] * testf[l] * W;
1972  }
1973 
1974  // du/dt term
1975  jacobian(local_eqn, local_unknown) -=
1976  scaled_re_st *
1977  node_pt(l2)->time_stepper_pt()->weight(1, 0) *
1978  psif[l2] * testf[l] * W;
1979 
1980  // Loop over the velocity components
1981  for (unsigned k = 0; k < DIM; k++)
1982  {
1983  double tmp = scaled_re * interpolated_u[k];
1984  if (!ALE_is_disabled)
1985  tmp -= scaled_re_st * mesh_velocity[k];
1986  jacobian(local_eqn, local_unknown) -=
1987  tmp * dpsifdx(l2, k) * testf[l] * W;
1988  }
1989  }
1990  }
1991  }
1992  }
1993 
1994  /*Now loop over pressure shape functions*/
1995  /*This is the contribution from pressure gradient*/
1996  for (unsigned l2 = 0; l2 < n_pres; l2++)
1997  {
1998  /*If we are at a non-zero degree of freedom in the entry*/
1999  local_unknown = p_local_eqn(l2);
2000  if (local_unknown >= 0)
2001  {
2003  {
2004  jacobian(local_eqn, local_unknown) +=
2005  visc_ratio * viscosity * psip[l2] * dtestfdx(l, i) * W;
2006  }
2007  else
2008  {
2009  jacobian(local_eqn, local_unknown) +=
2010  psip[l2] * dtestfdx(l, i) * W;
2011  }
2012  }
2013  }
2014  } /*End of Jacobian calculation*/
2015 
2016  } // End of if not boundary condition statement
2017 
2018  } // End of loop over dimension
2019  } // End of loop over shape functions
2020 
2021 
2022  // CONTINUITY EQUATION
2023  //-------------------
2024 
2025  // Loop over the shape functions
2026  for (unsigned l = 0; l < n_pres; l++)
2027  {
2028  local_eqn = p_local_eqn(l);
2029  // If not a boundary conditions
2030  if (local_eqn >= 0)
2031  {
2032  // Source term
2033  // residuals[local_eqn] -=source*testp[l]*W;
2034  double aux = -source;
2035 
2036  // Loop over velocity components
2037  for (unsigned k = 0; k < DIM; k++)
2038  {
2039  // residuals[local_eqn] += interpolated_dudx(k,k)*testp[l]*W;
2040  aux += interpolated_dudx(k, k);
2041  }
2042 
2043  // Potentially pre-multiply by viscosity ratio
2045  {
2046  residuals[local_eqn] += visc_ratio * viscosity * aux * testp[l] * W;
2047  }
2048  else
2049  {
2050  residuals[local_eqn] += aux * testp[l] * W;
2051  }
2052 
2053  /*CALCULATE THE JACOBIAN*/
2054  if (flag)
2055  {
2056  /*Loop over the velocity shape functions*/
2057  for (unsigned l2 = 0; l2 < n_node; l2++)
2058  {
2059  /*Loop over velocity components*/
2060  for (unsigned i2 = 0; i2 < DIM; i2++)
2061  {
2062  /*If we're at a non-zero degree of freedom add it in*/
2063  local_unknown = nodal_local_eqn(l2, u_nodal_index[i2]);
2064  if (local_unknown >= 0)
2065  {
2067  {
2068  jacobian(local_eqn, local_unknown) +=
2069  visc_ratio * viscosity * dpsifdx(l2, i2) * testp[l] * W;
2070  }
2071  else
2072  {
2073  jacobian(local_eqn, local_unknown) +=
2074  dpsifdx(l2, i2) * testp[l] * W;
2075  }
2076  }
2077  } /*End of loop over i2*/
2078  } /*End of loop over l2*/
2079  } /*End of Jacobian calculation*/
2080 
2081  } // End of if not boundary condition
2082  } // End of loop over l
2083  }
2084  }
JacobiRotation< float > G
Definition: Jacobi_makeGivens.cpp:2
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
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
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition: elements.h:835
virtual double get_source_nst(const double &time, const unsigned &ipt, const Vector< double > &x)
Definition: generalised_newtonian_navier_stokes_elements.h:318
static bool Pre_multiply_by_viscosity_ratio
Definition: generalised_newtonian_navier_stokes_elements.h:159
virtual void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Definition: generalised_newtonian_navier_stokes_elements.h:250
virtual double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
const double & viscosity_ratio() const
Definition: generalised_newtonian_navier_stokes_elements.h:455
const Vector< double > & g() const
Vector of gravitational components.
Definition: generalised_newtonian_navier_stokes_elements.h:492
const double & re_invfr() const
Global inverse Froude number.
Definition: generalised_newtonian_navier_stokes_elements.h:480
virtual void pshape_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
Definition: generalised_newtonian_navier_stokes_elements.h:425
virtual unsigned npres_nst() const =0
Function to return number of pressure degrees of freedom.
const double & density_ratio() const
Definition: generalised_newtonian_navier_stokes_elements.h:468
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
Definition: generalised_newtonian_navier_stokes_elements.h:436
virtual double p_nst(const unsigned &n_p) const =0
const double & re() const
Reynolds number.
Definition: generalised_newtonian_navier_stokes_elements.h:430
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
int * m
Definition: level2_cplx_impl.h:294
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
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
double second_invariant(const DenseMatrix< double > &tensor)
Compute second invariant of tensor.
Definition: oomph_utilities.cc:163

References oomph::ALE_is_disabled, Global_Parameters::body_force(), DIM, extrapolated_strain_rate(), G, GlobalPhysicalVariables::Gamma, i, J, j, k, m, n, s, oomph::SecondInvariantHelper::second_invariant(), TestProblem::source(), tmp, w, and oomph::QuadTreeNames::W.

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_jacobian(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_jacobian_and_mass_matrix(), and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_contribution_to_residuals().

◆ fix_pressure()

◆ full_output() [1/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::full_output ( std::ostream &  outfile)
inline

Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format. Default number of plot points

863  {
864  unsigned nplot = 5;
865  full_output(outfile, nplot);
866  }
void full_output(std::ostream &outfile)
Definition: generalised_newtonian_navier_stokes_elements.h:862

Referenced by oomph::GeneralisedNewtonianQCrouzeixRaviartElement< DIM >::full_output(), and oomph::GeneralisedNewtonianTCrouzeixRaviartElement< DIM >::full_output().

◆ full_output() [2/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::full_output ( std::ostream &  outfile,
const unsigned nplot 
)

Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format. nplot points in each coordinate direction

Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format. Specified number of plot points in each coordinate direction

633  {
634  // Vector of local coordinates
635  Vector<double> s(DIM);
636 
637  // Acceleration
638  Vector<double> dudt(DIM);
639 
640  // Mesh elocity
641  Vector<double> mesh_veloc(DIM, 0.0);
642 
643  // Tecplot header info
644  outfile << tecplot_zone_string(nplot);
645 
646  // Find out how many nodes there are
647  unsigned n_node = nnode();
648 
649  // Set up memory for the shape functions
650  Shape psif(n_node);
651  DShape dpsifdx(n_node, DIM);
652 
653  // Loop over plot points
654  unsigned num_plot_points = nplot_points(nplot);
655  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
656  {
657  // Get local coordinates of plot point
658  get_s_plot(iplot, nplot, s);
659 
660  // Call the derivatives of the shape and test functions
661  dshape_eulerian(s, psif, dpsifdx);
662 
663  // Allocate storage
664  Vector<double> mesh_veloc(DIM);
665  Vector<double> dudt(DIM);
666  Vector<double> dudt_ALE(DIM);
667  DenseMatrix<double> interpolated_dudx(DIM, DIM);
668 
669  // Initialise everything to zero
670  for (unsigned i = 0; i < DIM; i++)
671  {
672  mesh_veloc[i] = 0.0;
673  dudt[i] = 0.0;
674  dudt_ALE[i] = 0.0;
675  for (unsigned j = 0; j < DIM; j++)
676  {
677  interpolated_dudx(i, j) = 0.0;
678  }
679  }
680 
681  // Calculate velocities and derivatives
682 
683 
684  // Loop over directions
685  for (unsigned i = 0; i < DIM; i++)
686  {
687  // Get the index at which velocity i is stored
688  unsigned u_nodal_index = u_index_nst(i);
689  // Loop over nodes
690  for (unsigned l = 0; l < n_node; l++)
691  {
692  dudt[i] += du_dt_nst(l, u_nodal_index) * psif[l];
693  mesh_veloc[i] += dnodal_position_dt(l, i) * psif[l];
694 
695  // Loop over derivative directions for velocity gradients
696  for (unsigned j = 0; j < DIM; j++)
697  {
698  interpolated_dudx(i, j) +=
699  nodal_value(l, u_nodal_index) * dpsifdx(l, j);
700  }
701  }
702  }
703 
704 
705  // Get dudt in ALE form (incl mesh veloc)
706  for (unsigned i = 0; i < DIM; i++)
707  {
708  dudt_ALE[i] = dudt[i];
709  for (unsigned k = 0; k < DIM; k++)
710  {
711  dudt_ALE[i] -= mesh_veloc[k] * interpolated_dudx(i, k);
712  }
713  }
714 
715 
716  // Coordinates
717  for (unsigned i = 0; i < DIM; i++)
718  {
719  outfile << interpolated_x(s, i) << " ";
720  }
721 
722  // Velocities
723  for (unsigned i = 0; i < DIM; i++)
724  {
725  outfile << interpolated_u_nst(s, i) << " ";
726  }
727 
728  // Pressure
729  outfile << interpolated_p_nst(s) << " ";
730 
731  // Accelerations
732  for (unsigned i = 0; i < DIM; i++)
733  {
734  outfile << dudt_ALE[i] << " ";
735  }
736 
737  // // Mesh velocity
738  // for(unsigned i=0;i<DIM;i++)
739  // {
740  // outfile << mesh_veloc[i] << " ";
741  // }
742 
743  // Dissipation
744  outfile << dissipation(s) << " ";
745 
746 
747  outfile << std::endl;
748  }
749 
750  // Write tecplot footer (e.g. FE connectivity lists)
751  write_tecplot_zone_footer(outfile, nplot);
752  }
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 dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3298
double dissipation() const
Return integral of dissipation over element.
Definition: generalised_newtonian_navier_stokes_elements.cc:830
virtual double interpolated_p_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
Definition: generalised_newtonian_navier_stokes_elements.h:1227

References DIM, i, j, k, and s.

◆ g()

template<unsigned DIM>
const Vector<double>& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::g ( ) const
inline

Vector of gravitational components.

493  {
494  return *G_pt;
495  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::G_pt.

◆ g_pt()

template<unsigned DIM>
Vector<double>*& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::g_pt ( )
inline

Pointer to Vector of gravitational components.

499  {
500  return G_pt;
501  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::G_pt.

◆ get_body_force_gradient_nst()

template<unsigned DIM>
virtual void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_body_force_gradient_nst ( const double time,
const unsigned ipt,
const Vector< double > &  s,
const Vector< double > &  x,
DenseMatrix< double > &  d_body_force_dx 
)
inlineprotectedvirtual

Get gradient of body force term at (Eulerian) position x. This function is virtual to allow overloading in multi-physics problems where the strength of the source function might be determined by another system of equations. Computed via function pointer (if set) or by finite differencing (default)

283  {
284  // hierher: Implement function pointer version
285  /* //If no gradient function has been set, FD it */
286  /* if(Body_force_fct_gradient_pt==0) */
287  {
288  // Reference value
289  Vector<double> body_force(DIM, 0.0);
290  get_body_force_nst(time, ipt, s, x, body_force);
291 
292  // FD it
294  Vector<double> body_force_pls(DIM, 0.0);
295  Vector<double> x_pls(x);
296  for (unsigned i = 0; i < DIM; i++)
297  {
298  x_pls[i] += eps_fd;
299  get_body_force_nst(time, ipt, s, x_pls, body_force_pls);
300  for (unsigned j = 0; j < DIM; j++)
301  {
302  d_body_force_dx(j, i) =
303  (body_force_pls[j] - body_force[j]) / eps_fd;
304  }
305  x_pls[i] = x[i];
306  }
307  }
308  /* else */
309  /* { */
310  /* // Get gradient */
311  /* (*Source_fct_gradient_pt)(time,x,gradient); */
312  /* } */
313  }
static double Default_fd_jacobian_step
Definition: elements.h:1198

References Global_Parameters::body_force(), oomph::GeneralisedElement::Default_fd_jacobian_step, DIM, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_body_force_nst(), i, j, s, and plotDoE::x.

◆ get_body_force_nst()

template<unsigned DIM>
virtual void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_body_force_nst ( const double time,
const unsigned ipt,
const Vector< double > &  s,
const Vector< double > &  x,
Vector< double > &  result 
)
inlineprotectedvirtual

Calculate the body force at a given time and local and/or Eulerian position. This function is virtual so that it can be overloaded in multi-physics elements where the body force might depend on another variable.

255  {
256  // If the function pointer is zero return zero
257  if (Body_force_fct_pt == 0)
258  {
259  // Loop over dimensions and set body forces to zero
260  for (unsigned i = 0; i < DIM; i++)
261  {
262  result[i] = 0.0;
263  }
264  }
265  // Otherwise call the function
266  else
267  {
268  (*Body_force_fct_pt)(time, x, result);
269  }
270  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Body_force_fct_pt, DIM, i, and plotDoE::x.

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_body_force_gradient_nst().

◆ get_dresidual_dnodal_coordinates()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates ( RankThreeTensor< double > &  dresidual_dnodal_coordinates)
virtual

Compute derivatives of elemental residual vector with respect to nodal coordinates. Overwrites default implementation in FiniteElement base class. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}

Compute derivatives of elemental residual vector with respect to nodal coordinates. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij} Overloads the FD-based version in the FE base class.

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >.

2133  {
2134  // Return immediately if there are no dofs
2135  if (ndof() == 0)
2136  {
2137  return;
2138  }
2139 
2140  // Determine number of nodes in element
2141  const unsigned n_node = nnode();
2142 
2143  // Get continuous time from timestepper of first node
2144  double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
2145 
2146  // Determine number of pressure dofs in element
2147  const unsigned n_pres = npres_nst();
2148 
2149  // Find the indices at which the local velocities are stored
2150  unsigned u_nodal_index[DIM];
2151  for (unsigned i = 0; i < DIM; i++)
2152  {
2153  u_nodal_index[i] = u_index_nst(i);
2154  }
2155 
2156  // Set up memory for the shape and test functions
2157  Shape psif(n_node), testf(n_node);
2158  DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
2159 
2160  // Set up memory for pressure shape and test functions
2161  Shape psip(n_pres), testp(n_pres);
2162 
2163  // Deriatives of shape fct derivatives w.r.t. nodal coords
2164  RankFourTensor<double> d_dpsifdx_dX(DIM, n_node, n_node, DIM);
2165  RankFourTensor<double> d_dtestfdx_dX(DIM, n_node, n_node, DIM);
2166 
2167  // Derivative of Jacobian of mapping w.r.t. to nodal coords
2168  DenseMatrix<double> dJ_dX(DIM, n_node);
2169 
2170  // Derivatives of derivative of u w.r.t. nodal coords
2171  RankFourTensor<double> d_dudx_dX(DIM, n_node, DIM, DIM);
2172 
2173  // Derivatives of nodal velocities w.r.t. nodal coords:
2174  // Assumption: Interaction only local via no-slip so
2175  // X_ij only affects U_ij.
2176  DenseMatrix<double> d_U_dX(DIM, n_node, 0.0);
2177 
2178  // Determine the number of integration points
2179  const unsigned n_intpt = integral_pt()->nweight();
2180 
2181  // Vector to hold local coordinates
2182  Vector<double> s(DIM);
2183 
2184  // Get physical variables from element
2185  // (Reynolds number must be multiplied by the density ratio)
2186  double scaled_re = re() * density_ratio();
2187  double scaled_re_st = re_st() * density_ratio();
2188  double scaled_re_inv_fr = re_invfr() * density_ratio();
2189  double visc_ratio = viscosity_ratio();
2190  Vector<double> G = g();
2191 
2192  // FD step
2194 
2195  // Pre-compute derivatives of nodal velocities w.r.t. nodal coords:
2196  // Assumption: Interaction only local via no-slip so
2197  // X_ij only affects U_ij.
2198  bool element_has_node_with_aux_node_update_fct = false;
2199  for (unsigned q = 0; q < n_node; q++)
2200  {
2201  Node* nod_pt = node_pt(q);
2202 
2203  // Only compute if there's a node-update fct involved
2204  if (nod_pt->has_auxiliary_node_update_fct_pt())
2205  {
2206  element_has_node_with_aux_node_update_fct = true;
2207 
2208  // Current nodal velocity
2209  Vector<double> u_ref(DIM);
2210  for (unsigned i = 0; i < DIM; i++)
2211  {
2212  u_ref[i] = *(nod_pt->value_pt(u_nodal_index[i]));
2213  }
2214 
2215  // FD
2216  for (unsigned p = 0; p < DIM; p++)
2217  {
2218  // Make backup
2219  double backup = nod_pt->x(p);
2220 
2221  // Do FD step. No node update required as we're
2222  // attacking the coordinate directly...
2223  nod_pt->x(p) += eps_fd;
2224 
2225  // Do auxiliary node update (to apply no slip)
2226  nod_pt->perform_auxiliary_node_update_fct();
2227 
2228  // Evaluate
2229  d_U_dX(p, q) =
2230  (*(nod_pt->value_pt(u_nodal_index[p])) - u_ref[p]) / eps_fd;
2231 
2232  // Reset
2233  nod_pt->x(p) = backup;
2234 
2235  // Do auxiliary node update (to apply no slip)
2236  nod_pt->perform_auxiliary_node_update_fct();
2237  }
2238  }
2239  }
2240 
2241  // Integer to store the local equation number
2242  int local_eqn = 0;
2243 
2244  // Loop over the integration points
2245  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
2246  {
2247  // Assign values of s
2248  for (unsigned i = 0; i < DIM; i++)
2249  {
2250  s[i] = integral_pt()->knot(ipt, i);
2251  }
2252 
2253  // Get the integral weight
2254  const double w = integral_pt()->weight(ipt);
2255 
2256  // Call the derivatives of the shape and test functions
2257  const double J = dshape_and_dtest_eulerian_at_knot_nst(ipt,
2258  psif,
2259  dpsifdx,
2260  d_dpsifdx_dX,
2261  testf,
2262  dtestfdx,
2263  d_dtestfdx_dX,
2264  dJ_dX);
2265 
2266  // Call the pressure shape and test functions
2267  pshape_nst(s, psip, testp);
2268 
2269  // Calculate local values of the pressure and velocity components
2270  // Allocate
2271  double interpolated_p = 0.0;
2272  Vector<double> interpolated_u(DIM, 0.0);
2273  Vector<double> interpolated_x(DIM, 0.0);
2274  Vector<double> mesh_velocity(DIM, 0.0);
2275  Vector<double> dudt(DIM, 0.0);
2276  DenseMatrix<double> interpolated_dudx(DIM, DIM, 0.0);
2277 
2278  // Calculate pressure
2279  for (unsigned l = 0; l < n_pres; l++)
2280  {
2281  interpolated_p += p_nst(l) * psip[l];
2282  }
2283 
2284  // Calculate velocities and derivatives:
2285 
2286  // Loop over nodes
2287  for (unsigned l = 0; l < n_node; l++)
2288  {
2289  // Loop over directions
2290  for (unsigned i = 0; i < DIM; i++)
2291  {
2292  // Get the nodal value
2293  double u_value = raw_nodal_value(l, u_nodal_index[i]);
2294  interpolated_u[i] += u_value * psif[l];
2295  interpolated_x[i] += raw_nodal_position(l, i) * psif[l];
2296  dudt[i] += du_dt_nst(l, i) * psif[l];
2297 
2298  // Loop over derivative directions
2299  for (unsigned j = 0; j < DIM; j++)
2300  {
2301  interpolated_dudx(i, j) += u_value * dpsifdx(l, j);
2302  }
2303  }
2304  }
2305 
2306  if (!ALE_is_disabled)
2307  {
2308  // Loop over nodes
2309  for (unsigned l = 0; l < n_node; l++)
2310  {
2311  // Loop over directions
2312  for (unsigned i = 0; i < DIM; i++)
2313  {
2314  mesh_velocity[i] += this->raw_dnodal_position_dt(l, i) * psif[l];
2315  }
2316  }
2317  }
2318 
2319  // Calculate derivative of du_i/dx_k w.r.t. nodal positions X_{pq}
2320  for (unsigned q = 0; q < n_node; q++)
2321  {
2322  // Loop over coordinate directions
2323  for (unsigned p = 0; p < DIM; p++)
2324  {
2325  for (unsigned i = 0; i < DIM; i++)
2326  {
2327  for (unsigned k = 0; k < DIM; k++)
2328  {
2329  double aux = 0.0;
2330  for (unsigned j = 0; j < n_node; j++)
2331  {
2332  aux += raw_nodal_value(j, u_nodal_index[i]) *
2333  d_dpsifdx_dX(p, q, j, k);
2334  }
2335  d_dudx_dX(p, q, i, k) = aux;
2336  }
2337  }
2338  }
2339  }
2340 
2341  // Get weight of actual nodal position/value in computation of mesh
2342  // velocity from positional/value time stepper
2343  const double pos_time_weight =
2345  const double val_time_weight =
2346  node_pt(0)->time_stepper_pt()->weight(1, 0);
2347 
2348  // Get the user-defined body force terms
2349  Vector<double> body_force(DIM);
2351 
2352  // Get the user-defined source function
2353  const double source = get_source_nst(time, ipt, interpolated_x);
2354 
2355  // Note: Can use raw values and avoid bypassing hanging information
2356  // because this is the non-refineable version!
2357 
2358  // Get gradient of body force function
2359  DenseMatrix<double> d_body_force_dx(DIM, DIM, 0.0);
2361  time, ipt, s, interpolated_x, d_body_force_dx);
2362 
2363  // Get gradient of source function
2364  Vector<double> source_gradient(DIM, 0.0);
2365  get_source_gradient_nst(time, ipt, interpolated_x, source_gradient);
2366 
2367 
2368  // Assemble shape derivatives
2369  // --------------------------
2370 
2371  // MOMENTUM EQUATIONS
2372  // ------------------
2373 
2374  // Loop over the test functions
2375  for (unsigned l = 0; l < n_node; l++)
2376  {
2377  // Loop over coordinate directions
2378  for (unsigned i = 0; i < DIM; i++)
2379  {
2380  // Get the local equation
2381  local_eqn = nodal_local_eqn(l, u_nodal_index[i]);
2382  ;
2383 
2384  // IF it's not a boundary condition
2385  if (local_eqn >= 0)
2386  {
2387  // Loop over coordinate directions
2388  for (unsigned p = 0; p < DIM; p++)
2389  {
2390  // Loop over nodes
2391  for (unsigned q = 0; q < n_node; q++)
2392  {
2393  // Residual x deriv of Jacobian
2394  //-----------------------------
2395 
2396  // Add the user-defined body force terms
2397  double sum = body_force[i] * testf[l];
2398 
2399  // Add the gravitational body force term
2400  sum += scaled_re_inv_fr * testf[l] * G[i];
2401 
2402  // Add the pressure gradient term
2403  sum += interpolated_p * dtestfdx(l, i);
2404 
2405  // Add in the stress tensor terms
2406  // The viscosity ratio needs to go in here to ensure
2407  // continuity of normal stress is satisfied even in flows
2408  // with zero pressure gradient!
2409  for (unsigned k = 0; k < DIM; k++)
2410  {
2411  sum -= visc_ratio *
2412  (interpolated_dudx(i, k) +
2413  Gamma[i] * interpolated_dudx(k, i)) *
2414  dtestfdx(l, k);
2415  }
2416 
2417  // Add in the inertial terms
2418 
2419  // du/dt term
2420  sum -= scaled_re_st * dudt[i] * testf[l];
2421 
2422  // Convective terms, including mesh velocity
2423  for (unsigned k = 0; k < DIM; k++)
2424  {
2425  double tmp = scaled_re * interpolated_u[k];
2426  if (!ALE_is_disabled)
2427  {
2428  tmp -= scaled_re_st * mesh_velocity[k];
2429  }
2430  sum -= tmp * interpolated_dudx(i, k) * testf[l];
2431  }
2432 
2433  // Multiply through by deriv of Jacobian and integration weight
2434  dresidual_dnodal_coordinates(local_eqn, p, q) +=
2435  sum * dJ_dX(p, q) * w;
2436 
2437  // Derivative of residual x Jacobian
2438  //----------------------------------
2439 
2440  // Body force
2441  sum = d_body_force_dx(i, p) * psif(q) * testf(l);
2442 
2443  // Pressure gradient term
2444  sum += interpolated_p * d_dtestfdx_dX(p, q, l, i);
2445 
2446  // Viscous term
2447  for (unsigned k = 0; k < DIM; k++)
2448  {
2449  sum -= visc_ratio * ((interpolated_dudx(i, k) +
2450  Gamma[i] * interpolated_dudx(k, i)) *
2451  d_dtestfdx_dX(p, q, l, k) +
2452  (d_dudx_dX(p, q, i, k) +
2453  Gamma[i] * d_dudx_dX(p, q, k, i)) *
2454  dtestfdx(l, k));
2455  }
2456 
2457  // Convective terms, including mesh velocity
2458  for (unsigned k = 0; k < DIM; k++)
2459  {
2460  double tmp = scaled_re * interpolated_u[k];
2461  if (!ALE_is_disabled)
2462  {
2463  tmp -= scaled_re_st * mesh_velocity[k];
2464  }
2465  sum -= tmp * d_dudx_dX(p, q, i, k) * testf(l);
2466  }
2467  if (!ALE_is_disabled)
2468  {
2469  sum += scaled_re_st * pos_time_weight * psif(q) *
2470  interpolated_dudx(i, p) * testf(l);
2471  }
2472 
2473  // Multiply through by Jacobian and integration weight
2474  dresidual_dnodal_coordinates(local_eqn, p, q) += sum * J * w;
2475 
2476  // Derivs w.r.t. to nodal velocities
2477  // ---------------------------------
2478  if (element_has_node_with_aux_node_update_fct)
2479  {
2480  sum =
2481  -visc_ratio * Gamma[i] * dpsifdx(q, i) * dtestfdx(l, p) -
2482  scaled_re * psif(q) * interpolated_dudx(i, p) * testf(l);
2483  if (i == p)
2484  {
2485  sum -= scaled_re_st * val_time_weight * psif(q) * testf(l);
2486  for (unsigned k = 0; k < DIM; k++)
2487  {
2488  sum -= visc_ratio * dpsifdx(q, k) * dtestfdx(l, k);
2489  double tmp = scaled_re * interpolated_u[k];
2490  if (!ALE_is_disabled)
2491  tmp -= scaled_re_st * mesh_velocity[k];
2492  sum -= tmp * dpsifdx(q, k) * testf(l);
2493  }
2494  }
2495  dresidual_dnodal_coordinates(local_eqn, p, q) +=
2496  sum * d_U_dX(p, q) * J * w;
2497  }
2498  }
2499  }
2500  }
2501  }
2502  } // End of loop over test functions
2503 
2504 
2505  // CONTINUITY EQUATION
2506  // -------------------
2507 
2508  // Loop over the shape functions
2509  for (unsigned l = 0; l < n_pres; l++)
2510  {
2511  local_eqn = p_local_eqn(l);
2512 
2513  // If not a boundary conditions
2514  if (local_eqn >= 0)
2515  {
2516  // Loop over coordinate directions
2517  for (unsigned p = 0; p < DIM; p++)
2518  {
2519  // Loop over nodes
2520  for (unsigned q = 0; q < n_node; q++)
2521  {
2522  // Residual x deriv of Jacobian
2523  //-----------------------------
2524 
2525  // Source term
2526  double aux = -source;
2527 
2528  // Loop over velocity components
2529  for (unsigned k = 0; k < DIM; k++)
2530  {
2531  aux += interpolated_dudx(k, k);
2532  }
2533 
2534  // Multiply through by deriv of Jacobian and integration weight
2535  dresidual_dnodal_coordinates(local_eqn, p, q) +=
2536  aux * dJ_dX(p, q) * testp[l] * w;
2537 
2538  // Derivative of residual x Jacobian
2539  //----------------------------------
2540 
2541  // Loop over velocity components
2542  aux = -source_gradient[p] * psif(q);
2543  for (unsigned k = 0; k < DIM; k++)
2544  {
2545  aux += d_dudx_dX(p, q, k, k);
2546  }
2547  // Multiply through by Jacobian and integration weight
2548  dresidual_dnodal_coordinates(local_eqn, p, q) +=
2549  aux * testp[l] * J * w;
2550 
2551  // Derivs w.r.t. to nodal velocities
2552  //---------------------------------
2553  if (element_has_node_with_aux_node_update_fct)
2554  {
2555  aux = dpsifdx(q, p) * testp(l);
2556  dresidual_dnodal_coordinates(local_eqn, p, q) +=
2557  aux * d_U_dX(p, q) * J * w;
2558  }
2559  }
2560  }
2561  }
2562  }
2563  } // End of loop over integration points
2564  }
float * p
Definition: Tutorial_Map_using.cpp:9
virtual void get_body_force_gradient_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &d_body_force_dx)
Definition: generalised_newtonian_navier_stokes_elements.h:277
virtual void get_source_gradient_nst(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
Definition: generalised_newtonian_navier_stokes_elements.h:340
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition: nodes.h:1022
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:2019

References oomph::ALE_is_disabled, Global_Parameters::body_force(), oomph::GeneralisedElement::Default_fd_jacobian_step, DIM, G, GlobalPhysicalVariables::Gamma, oomph::Node::has_auxiliary_node_update_fct_pt(), i, J, j, k, p, oomph::Node::perform_auxiliary_node_update_fct(), Eigen::numext::q, s, TestProblem::source(), tmp, oomph::Data::value_pt(), w, and oomph::Node::x().

◆ get_load()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_load ( const Vector< double > &  s,
const Vector< double > &  N,
Vector< double > &  load 
)
inlinevirtual

This implements a pure virtual function defined in the FSIFluidElement class. The function computes the traction (on the viscous scale), at the element's local coordinate s, that the fluid element exerts onto an adjacent solid element. The number of arguments is imposed by the interface defined in the FSIFluidElement – only the unit normal N (pointing into the fluid!) is actually used in the computation.

Implements oomph::FSIFluidElement.

737  {
738  // Note: get_traction() computes the traction onto the fluid
739  // if N is the outer unit normal onto the fluid; here we're
740  // exepcting N to point into the fluid so we're getting the
741  // traction onto the adjacent wall instead!
742  get_traction(s, N, load);
743  }
void load(Archive &ar, ParticleHandler &handl)
Definition: Particles.h:21
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
Definition: generalised_newtonian_navier_stokes_elements.cc:887
@ N
Definition: constructor.cpp:22

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_traction(), load(), N, and s.

◆ get_pressure_and_velocity_mass_matrix_diagonal()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_pressure_and_velocity_mass_matrix_diagonal ( Vector< double > &  press_mass_diag,
Vector< double > &  veloc_mass_diag,
const unsigned which_one = 0 
)
virtual

Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed, otherwise only the pressure (which_one=1) or the velocity mass matrix (which_one=2 – the LSC version of the preconditioner only needs that one)

Implements oomph::GeneralisedNewtonianTemplateFreeNavierStokesEquationsBase.

Reimplemented in oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >.

86  {
87  // Resize and initialise
88  unsigned n_dof = ndof();
89 
90  if ((which_one == 0) || (which_one == 1))
91  press_mass_diag.assign(n_dof, 0.0);
92  if ((which_one == 0) || (which_one == 2))
93  veloc_mass_diag.assign(n_dof, 0.0);
94 
95  // find out how many nodes there are
96  unsigned n_node = nnode();
97 
98  // find number of spatial dimensions
99  unsigned n_dim = this->dim();
100 
101  // Local coordinates
102  Vector<double> s(n_dim);
103 
104  // find the indices at which the local velocities are stored
105  Vector<unsigned> u_nodal_index(n_dim);
106  for (unsigned i = 0; i < n_dim; i++)
107  {
108  u_nodal_index[i] = this->u_index_nst(i);
109  }
110 
111  // Set up memory for veloc shape functions
112  Shape psi(n_node);
113 
114  // Find number of pressure dofs
115  unsigned n_pres = npres_nst();
116 
117  // Pressure shape function
118  Shape psi_p(n_pres);
119 
120  // Number of integration points
121  unsigned n_intpt = integral_pt()->nweight();
122 
123  // Integer to store the local equations no
124  int local_eqn = 0;
125 
126  // Loop over the integration points
127  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
128  {
129  // Get the integral weight
130  double w = integral_pt()->weight(ipt);
131 
132  // Get determinant of Jacobian of the mapping
133  double J = J_eulerian_at_knot(ipt);
134 
135  // Assign values of s
136  for (unsigned i = 0; i < n_dim; i++)
137  {
138  s[i] = integral_pt()->knot(ipt, i);
139  }
140 
141  // Premultiply weights and Jacobian
142  double W = w * J;
143 
144 
145  // Do we want the velocity one?
146  if ((which_one == 0) || (which_one == 2))
147  {
148  // Get the velocity shape functions
149  shape_at_knot(ipt, psi);
150 
151  // Loop over the veclocity shape functions
152  for (unsigned l = 0; l < n_node; l++)
153  {
154  // Loop over the velocity components
155  for (unsigned i = 0; i < n_dim; i++)
156  {
157  local_eqn = nodal_local_eqn(l, u_nodal_index[i]);
158 
159  // If not a boundary condition
160  if (local_eqn >= 0)
161  {
162  // Add the contribution
163  veloc_mass_diag[local_eqn] += pow(psi[l], 2) * W;
164  }
165  }
166  }
167  }
168 
169  // Do we want the pressure one?
170  if ((which_one == 0) || (which_one == 1))
171  {
172  // Get the pressure shape functions
173  pshape_nst(s, psi_p);
174 
175  // Loop over the veclocity shape functions
176  for (unsigned l = 0; l < n_pres; l++)
177  {
178  // Get equation number
179  local_eqn = p_local_eqn(l);
180 
181  // If not a boundary condition
182  if (local_eqn >= 0)
183  {
184  // Add the contribution
185  press_mass_diag[local_eqn] += pow(psi_p[l], 2) * W;
186  }
187  }
188  }
189  }
190  }
unsigned dim() const
Definition: elements.h:2611
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Definition: elements.cc:4168
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Definition: elements.cc:3220
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625

References i, J, Eigen::bfloat16_impl::pow(), s, w, and oomph::QuadTreeNames::W.

◆ get_source_gradient_nst()

template<unsigned DIM>
virtual void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_source_gradient_nst ( const double time,
const unsigned ipt,
const Vector< double > &  x,
Vector< double > &  gradient 
)
inlineprotectedvirtual

Get gradient of source term at (Eulerian) position x. This function is virtual to allow overloading in multi-physics problems where the strength of the source function might be determined by another system of equations. Computed via function pointer (if set) or by finite differencing (default)

344  {
345  // hierher: Implement function pointer version
346  /* //If no gradient function has been set, FD it */
347  /* if(Source_fct_gradient_pt==0) */
348  {
349  // Reference value
350  double source = get_source_nst(time, ipt, x);
351 
352  // FD it
354  double source_pls = 0.0;
355  Vector<double> x_pls(x);
356  for (unsigned i = 0; i < DIM; i++)
357  {
358  x_pls[i] += eps_fd;
359  source_pls = get_source_nst(time, ipt, x_pls);
360  gradient[i] = (source_pls - source) / eps_fd;
361  x_pls[i] = x[i];
362  }
363  }
364  /* else */
365  /* { */
366  /* // Get gradient */
367  /* (*Source_fct_gradient_pt)(time,x,gradient); */
368  /* } */
369  }

References oomph::GeneralisedElement::Default_fd_jacobian_step, DIM, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_source_nst(), i, TestProblem::source(), and plotDoE::x.

◆ get_source_nst()

template<unsigned DIM>
virtual double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_source_nst ( const double time,
const unsigned ipt,
const Vector< double > &  x 
)
inlineprotectedvirtual

Calculate the source fct at given time and Eulerian position

321  {
322  // If the function pointer is zero return zero
323  if (Source_fct_pt == 0)
324  {
325  return 0;
326  }
327  // Otherwise call the function
328  else
329  {
330  return (*Source_fct_pt)(time, x);
331  }
332  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Source_fct_pt, and plotDoE::x.

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_source_gradient_nst().

◆ get_traction() [1/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_traction ( const Vector< double > &  s,
const Vector< double > &  N,
Vector< double > &  traction 
)

Compute traction (on the viscous scale) exerted onto the fluid at local coordinate s. N has to be outer unit normal to the fluid.

889  {
890  // Get velocity gradients
891  DenseMatrix<double> strainrate(DIM, DIM, 0.0);
892 
893  // Do we use the current or extrapolated strainrate to compute
894  // the second invariant?
896  {
897  strain_rate(s, strainrate);
898  }
899  else
900  {
901  extrapolated_strain_rate(s, strainrate);
902  }
903 
904  // Get the second invariant of the rate of strain tensor
905  double second_invariant =
907 
908  double visc = Constitutive_eqn_pt->viscosity(second_invariant);
909 
910  // Get pressure
911  double press = interpolated_p_nst(s);
912 
913  // Loop over traction components
914  for (unsigned i = 0; i < DIM; i++)
915  {
916  traction[i] = -press * N[i];
917  for (unsigned j = 0; j < DIM; j++)
918  {
919  traction[i] += visc * 2.0 * strainrate(i, j) * N[j];
920  }
921  }
922  }

References DIM, extrapolated_strain_rate(), i, j, N, s, and oomph::SecondInvariantHelper::second_invariant().

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_load().

◆ get_traction() [2/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_traction ( const Vector< double > &  s,
const Vector< double > &  N,
Vector< double > &  traction_p,
Vector< double > &  traction_visc_n,
Vector< double > &  traction_visc_t 
)

Compute traction (on the viscous scale) exerted onto the fluid at local coordinate s, decomposed into pressure and normal and tangential viscous components. N has to be outer unit normal to the fluid.

937  {
938  Vector<double> traction_visc(DIM);
939 
940  // Get velocity gradients
941  DenseMatrix<double> strainrate(DIM, DIM, 0.0);
942 
943  // Do we use the current or extrapolated strainrate to compute
944  // the second invariant?
946  {
947  strain_rate(s, strainrate);
948  }
949  else
950  {
951  extrapolated_strain_rate(s, strainrate);
952  }
953 
954  // Get the second invariant of the rate of strain tensor
955  double second_invariant =
957 
958  double visc = Constitutive_eqn_pt->viscosity(second_invariant);
959 
960  // Get pressure
961  double press = interpolated_p_nst(s);
962 
963  // Loop over traction components
964  for (unsigned i = 0; i < DIM; i++)
965  {
966  // pressure
967  traction_p[i] = -press * N[i];
968  for (unsigned j = 0; j < DIM; j++)
969  {
970  // viscous stress
971  traction_visc[i] += visc * 2.0 * strainrate(i, j) * N[j];
972  }
973  // Decompose viscous stress into normal and tangential components
974  traction_visc_n[i] = traction_visc[i] * N[i];
975  traction_visc_t[i] = traction_visc[i] - traction_visc_n[i];
976  }
977  }

References DIM, extrapolated_strain_rate(), i, j, N, s, and oomph::SecondInvariantHelper::second_invariant().

◆ get_vorticity() [1/3]

void oomph::GeneralisedNewtonianNavierStokesEquations< 2 >::get_vorticity ( const Vector< double > &  s,
Vector< double > &  vorticity 
) const

Compute 2D vorticity vector at local coordinate s (return in one and only component of vorticity vector

1228  {
1229 #ifdef PARANOID
1230  if (vorticity.size() != 1)
1231  {
1232  std::ostringstream error_message;
1233  error_message << "Computation of vorticity in 2D requires a 1D vector\n"
1234  << "which contains the only non-zero component of the\n"
1235  << "vorticity vector. You've passed a vector of size "
1236  << vorticity.size() << std::endl;
1237 
1238  throw OomphLibError(
1239  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1240  }
1241 #endif
1242 
1243  // Specify spatial dimension
1244  unsigned DIM = 2;
1245 
1246  // Velocity gradient matrix
1247  DenseMatrix<double> dudx(DIM);
1248 
1249  // Find out how many nodes there are in the element
1250  unsigned n_node = nnode();
1251 
1252  // Set up memory for the shape and test functions
1253  Shape psi(n_node);
1254  DShape dpsidx(n_node, DIM);
1255 
1256  // Call the derivatives of the shape functions
1257  dshape_eulerian(s, psi, dpsidx);
1258 
1259  // Initialise to zero
1260  for (unsigned i = 0; i < DIM; i++)
1261  {
1262  for (unsigned j = 0; j < DIM; j++)
1263  {
1264  dudx(i, j) = 0.0;
1265  }
1266  }
1267 
1268  // Loop over veclocity components
1269  for (unsigned i = 0; i < DIM; i++)
1270  {
1271  // Get the index at which the i-th velocity is stored
1272  unsigned u_nodal_index = u_index_nst(i);
1273  // Loop over derivative directions
1274  for (unsigned j = 0; j < DIM; j++)
1275  {
1276  // Loop over nodes
1277  for (unsigned l = 0; l < n_node; l++)
1278  {
1279  dudx(i, j) += nodal_value(l, u_nodal_index) * dpsidx(l, j);
1280  }
1281  }
1282  }
1283 
1284  // Z-component of vorticity
1285  vorticity[0] = dudx(1, 0) - dudx(0, 1);
1286  }

References DIM, i, j, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and s.

◆ get_vorticity() [2/3]

void oomph::GeneralisedNewtonianNavierStokesEquations< 3 >::get_vorticity ( const Vector< double > &  s,
Vector< double > &  vorticity 
) const

Compute 3D vorticity vector at local coordinate s.

1295  {
1296 #ifdef PARANOID
1297  if (vorticity.size() != 3)
1298  {
1299  std::ostringstream error_message;
1300  error_message << "Computation of vorticity in 3D requires a 3D vector\n"
1301  << "which contains the only non-zero component of the\n"
1302  << "vorticity vector. You've passed a vector of size "
1303  << vorticity.size() << std::endl;
1304 
1305  throw OomphLibError(
1306  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1307  }
1308 #endif
1309 
1310  // Specify spatial dimension
1311  unsigned DIM = 3;
1312 
1313  // Velocity gradient matrix
1314  DenseMatrix<double> dudx(DIM);
1315 
1316  // Find out how many nodes there are in the element
1317  unsigned n_node = nnode();
1318 
1319  // Set up memory for the shape and test functions
1320  Shape psi(n_node);
1321  DShape dpsidx(n_node, DIM);
1322 
1323  // Call the derivatives of the shape functions
1324  dshape_eulerian(s, psi, dpsidx);
1325 
1326  // Initialise to zero
1327  for (unsigned i = 0; i < DIM; i++)
1328  {
1329  for (unsigned j = 0; j < DIM; j++)
1330  {
1331  dudx(i, j) = 0.0;
1332  }
1333  }
1334 
1335  // Loop over veclocity components
1336  for (unsigned i = 0; i < DIM; i++)
1337  {
1338  // Get the index at which the i-th velocity component is stored
1339  unsigned u_nodal_index = u_index_nst(i);
1340  // Loop over derivative directions
1341  for (unsigned j = 0; j < DIM; j++)
1342  {
1343  // Loop over nodes
1344  for (unsigned l = 0; l < n_node; l++)
1345  {
1346  dudx(i, j) += nodal_value(l, u_nodal_index) * dpsidx(l, j);
1347  }
1348  }
1349  }
1350 
1351  vorticity[0] = dudx(2, 1) - dudx(1, 2);
1352  vorticity[1] = dudx(0, 2) - dudx(2, 0);
1353  vorticity[2] = dudx(1, 0) - dudx(0, 1);
1354  }

References DIM, i, j, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and s.

◆ get_vorticity() [3/3]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_vorticity ( const Vector< double > &  s,
Vector< double > &  vorticity 
) const

Compute the vorticity vector at local coordinate s.

◆ interpolated_p_nst() [1/2]

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_p_nst ( const unsigned t,
const Vector< double > &  s 
) const
inline

Return FE interpolated pressure at local coordinate s at time level t.

1250  {
1251  // Find number of nodes
1252  unsigned n_pres = npres_nst();
1253  // Local shape function
1254  Shape psi(n_pres);
1255  // Find values of shape function
1256  pshape_nst(s, psi);
1257 
1258  // Initialise value of p
1259  double interpolated_p = 0.0;
1260  // Loop over the local nodes and sum
1261  for (unsigned l = 0; l < n_pres; l++)
1262  {
1263  interpolated_p += p_nst(t, l) * psi[l];
1264  }
1265 
1266  return (interpolated_p);
1267  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::npres_nst(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::p_nst(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::pshape_nst(), s, and plotPSD::t.

◆ interpolated_p_nst() [2/2]

template<unsigned DIM>
virtual double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_p_nst ( const Vector< double > &  s) const
inlinevirtual

Return FE interpolated pressure at local coordinate s.

1228  {
1229  // Find number of nodes
1230  unsigned n_pres = npres_nst();
1231  // Local shape function
1232  Shape psi(n_pres);
1233  // Find values of shape function
1234  pshape_nst(s, psi);
1235 
1236  // Initialise value of p
1237  double interpolated_p = 0.0;
1238  // Loop over the local nodes and sum
1239  for (unsigned l = 0; l < n_pres; l++)
1240  {
1241  interpolated_p += p_nst(l) * psi[l];
1242  }
1243 
1244  return (interpolated_p);
1245  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::npres_nst(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::p_nst(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::pshape_nst(), and s.

Referenced by oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >::further_build(), oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >::further_build(), oomph::RefineableGeneralisedNewtonianQTaylorHoodElement< DIM >::get_interpolated_values(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::point_output_data(), and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::scalar_value_paraview().

◆ interpolated_u_nst() [1/3]

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_u_nst ( const unsigned t,
const Vector< double > &  s,
const unsigned i 
) const
inline

Return FE interpolated velocity u[i] at local coordinate s at time level t (t=0: present; t>0: history)

1146  {
1147  // Find number of nodes
1148  unsigned n_node = nnode();
1149 
1150  // Local shape function
1151  Shape psi(n_node);
1152 
1153  // Find values of shape function
1154  shape(s, psi);
1155 
1156  // Get nodal index at which i-th velocity is stored
1157  unsigned u_nodal_index = u_index_nst(i);
1158 
1159  // Initialise value of u
1160  double interpolated_u = 0.0;
1161  // Loop over the local nodes and sum
1162  for (unsigned l = 0; l < n_node; l++)
1163  {
1164  interpolated_u += nodal_value(t, l, u_nodal_index) * psi[l];
1165  }
1166 
1167  return (interpolated_u);
1168  }

References i, oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_value(), s, oomph::FiniteElement::shape(), plotPSD::t, and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_index_nst().

◆ interpolated_u_nst() [2/3]

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_u_nst ( const Vector< double > &  s,
const unsigned i 
) const
inline

Return FE interpolated velocity u[i] at local coordinate s.

1119  {
1120  // Find number of nodes
1121  unsigned n_node = nnode();
1122  // Local shape function
1123  Shape psi(n_node);
1124  // Find values of shape function
1125  shape(s, psi);
1126 
1127  // Get nodal index at which i-th velocity is stored
1128  unsigned u_nodal_index = u_index_nst(i);
1129 
1130  // Initialise value of u
1131  double interpolated_u = 0.0;
1132  // Loop over the local nodes and sum
1133  for (unsigned l = 0; l < n_node; l++)
1134  {
1135  interpolated_u += nodal_value(l, u_nodal_index) * psi[l];
1136  }
1137 
1138  return (interpolated_u);
1139  }

References i, oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_value(), s, oomph::FiniteElement::shape(), and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_index_nst().

◆ interpolated_u_nst() [3/3]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_u_nst ( const Vector< double > &  s,
Vector< double > &  veloc 
) const
inline

Compute vector of FE interpolated velocity u at local coordinate s.

1095  {
1096  // Find number of nodes
1097  unsigned n_node = nnode();
1098  // Local shape function
1099  Shape psi(n_node);
1100  // Find values of shape function
1101  shape(s, psi);
1102 
1103  for (unsigned i = 0; i < DIM; i++)
1104  {
1105  // Index at which the nodal value is stored
1106  unsigned u_nodal_index = u_index_nst(i);
1107  // Initialise value of u
1108  veloc[i] = 0.0;
1109  // Loop over the local nodes and sum
1110  for (unsigned l = 0; l < n_node; l++)
1111  {
1112  veloc[i] += nodal_value(l, u_nodal_index) * psi[l];
1113  }
1114  }
1115  }

References DIM, i, oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_value(), s, oomph::FiniteElement::shape(), and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_index_nst().

Referenced by oomph::RefineableGeneralisedNewtonianQTaylorHoodElement< DIM >::get_interpolated_values(), oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >::get_interpolated_values(), oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >::get_interpolated_values(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::point_output_data(), and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::scalar_value_paraview().

◆ kin_energy()

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::kin_energy

Get integral of kinetic energy over element.

Get integral of kinetic energy over element: 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.

1367  {
1368  throw OomphLibError(
1369  "Check the kinetic energy calculation for GeneralisedNewtonian NSt",
1372 
1373  // Initialise
1374  double kin_en = 0.0;
1375 
1376  // Set the value of n_intpt
1377  unsigned n_intpt = integral_pt()->nweight();
1378 
1379  // Set the Vector to hold local coordinates
1380  Vector<double> s(DIM);
1381 
1382  // Loop over the integration points
1383  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
1384  {
1385  // Assign values of s
1386  for (unsigned i = 0; i < DIM; i++)
1387  {
1388  s[i] = integral_pt()->knot(ipt, i);
1389  }
1390 
1391  // Get the integral weight
1392  double w = integral_pt()->weight(ipt);
1393 
1394  // Get Jacobian of mapping
1395  double J = J_eulerian(s);
1396 
1397  // Loop over directions
1398  double veloc_squared = 0.0;
1399  for (unsigned i = 0; i < DIM; i++)
1400  {
1401  veloc_squared += interpolated_u_nst(s, i) * interpolated_u_nst(s, i);
1402  }
1403 
1404  kin_en += 0.5 * veloc_squared * w * J;
1405  }
1406 
1407  return kin_en;
1408  }

References DIM, i, J, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, and w.

◆ max_and_min_invariant_and_viscosity()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::max_and_min_invariant_and_viscosity ( double min_invariant,
double max_invariant,
double min_viscosity,
double max_viscosity 
) const

Get max. and min. strain rate invariant and visocosity over all integration points in element

1563  {
1564  // Initialise
1565  min_invariant = DBL_MAX;
1566  max_invariant = -DBL_MAX;
1567  min_viscosity = DBL_MAX;
1568  max_viscosity = -DBL_MAX;
1569 
1570  // Number of integration points
1571  unsigned Nintpt = integral_pt()->nweight();
1572 
1573  // Set the Vector to hold local coordinates
1574  Vector<double> s(DIM);
1575 
1576  // Loop over the integration points
1577  for (unsigned ipt = 0; ipt < Nintpt; ipt++)
1578  {
1579  // Assign values of s
1580  for (unsigned i = 0; i < DIM; i++) s[i] = integral_pt()->knot(ipt, i);
1581 
1582  // The strainrate
1583  DenseMatrix<double> strainrate(DIM, DIM, 0.0);
1584  strain_rate(s, strainrate);
1585 
1586  // Calculate the second invariant
1587  double second_invariant =
1589 
1590  // Get the viscosity according to the constitutive equation
1591  double viscosity = Constitutive_eqn_pt->viscosity(second_invariant);
1592 
1593  min_invariant = std::min(min_invariant, second_invariant);
1594  max_invariant = std::max(max_invariant, second_invariant);
1595  min_viscosity = std::min(min_viscosity, viscosity);
1596  max_viscosity = std::max(max_viscosity, viscosity);
1597  }
1598  }
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
unsigned Nintpt
Number of integration points for new integration scheme (if used)
Definition: stefan_boltzmann.cc:112

References DIM, i, max, min, GlobalParameters::Nintpt, s, and oomph::SecondInvariantHelper::second_invariant().

◆ n_u_nst()

template<unsigned DIM>
unsigned oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::n_u_nst ( ) const
inline

Return the number of velocity components Used in FluidInterfaceElements

588  {
589  return DIM;
590  }

References DIM.

◆ npres_nst()

◆ nscalar_paraview()

template<unsigned DIM>
unsigned oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::nscalar_paraview ( ) const
inlinevirtual

Number of scalars/fields output by this element. Reimplements broken virtual function in base class.

Reimplemented from oomph::FiniteElement.

757  {
758  return DIM + 1;
759  }

References DIM.

◆ output() [1/4]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::output ( FILE *  file_pt)
inlinevirtual

C-style output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::PseudoSolidNodeUpdateElement< GeneralisedNewtonianTTaylorHoodElement< 2 >, TPVDElement< 2, 3 > >, oomph::GeneralisedNewtonianTTaylorHoodElement< DIM >, oomph::GeneralisedNewtonianTCrouzeixRaviartElement< DIM >, oomph::GeneralisedNewtonianQTaylorHoodElement< DIM >, and oomph::GeneralisedNewtonianQCrouzeixRaviartElement< DIM >.

850  {
851  unsigned nplot = 5;
852  output(file_pt, nplot);
853  }
void output(std::ostream &outfile)
Definition: generalised_newtonian_navier_stokes_elements.h:837

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::output().

◆ output() [2/4]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::output ( FILE *  file_pt,
const unsigned nplot 
)
virtual

C-style output function: x,y,[z],u,v,[w],p in tecplot format. nplot points in each coordinate direction

C-style output function: x,y,[z],u,v,[w],p in tecplot format. Specified number of plot points in each coordinate direction.

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::GeneralisedNewtonianQTaylorHoodElement< DIM >, oomph::GeneralisedNewtonianQCrouzeixRaviartElement< DIM >, oomph::GeneralisedNewtonianTTaylorHoodElement< DIM >, oomph::GeneralisedNewtonianTCrouzeixRaviartElement< DIM >, and oomph::PseudoSolidNodeUpdateElement< GeneralisedNewtonianTTaylorHoodElement< 2 >, TPVDElement< 2, 3 > >.

588  {
589  // Vector of local coordinates
590  Vector<double> s(DIM);
591 
592  // Tecplot header info
593  fprintf(file_pt, "%s", tecplot_zone_string(nplot).c_str());
594 
595  // Loop over plot points
596  unsigned num_plot_points = nplot_points(nplot);
597  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
598  {
599  // Get local coordinates of plot point
600  get_s_plot(iplot, nplot, s);
601 
602  // Coordinates
603  for (unsigned i = 0; i < DIM; i++)
604  {
605  fprintf(file_pt, "%g ", interpolated_x(s, i));
606  }
607 
608  // Velocities
609  for (unsigned i = 0; i < DIM; i++)
610  {
611  fprintf(file_pt, "%g ", interpolated_u_nst(s, i));
612  }
613 
614  // Pressure
615  fprintf(file_pt, "%g \n", interpolated_p_nst(s));
616  }
617  fprintf(file_pt, "\n");
618 
619  // Write tecplot footer (e.g. FE connectivity lists)
620  write_tecplot_zone_footer(file_pt, nplot);
621  }

References DIM, i, and s.

◆ output() [3/4]

◆ output() [4/4]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::output ( std::ostream &  outfile,
const unsigned nplot 
)
virtual

Output function: x,y,[z],u,v,[w],p in tecplot format. nplot points in each coordinate direction

Output function: x,y,[z],u,v,[w],p in tecplot format. Specified number of plot points in each coordinate direction.

Reimplemented from oomph::FiniteElement.

Reimplemented in oomph::GeneralisedNewtonianTTaylorHoodElement< DIM >, oomph::GeneralisedNewtonianTCrouzeixRaviartElement< DIM >, oomph::GeneralisedNewtonianQTaylorHoodElement< DIM >, oomph::GeneralisedNewtonianQCrouzeixRaviartElement< DIM >, and oomph::PseudoSolidNodeUpdateElement< GeneralisedNewtonianTTaylorHoodElement< 2 >, TPVDElement< 2, 3 > >.

541  {
542  // Vector of local coordinates
543  Vector<double> s(DIM);
544 
545  // Tecplot header info
546  outfile << tecplot_zone_string(nplot);
547 
548  // Loop over plot points
549  unsigned num_plot_points = nplot_points(nplot);
550  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
551  {
552  // Get local coordinates of plot point
553  get_s_plot(iplot, nplot, s);
554 
555  // Coordinates
556  for (unsigned i = 0; i < DIM; i++)
557  {
558  outfile << interpolated_x(s, i) << " ";
559  }
560 
561  // Velocities
562  for (unsigned i = 0; i < DIM; i++)
563  {
564  outfile << interpolated_u_nst(s, i) << " ";
565  }
566 
567  // Pressure
568  outfile << interpolated_p_nst(s) << " ";
569 
570  outfile << std::endl;
571  }
572  outfile << std::endl;
573 
574  // Write tecplot footer (e.g. FE connectivity lists)
575  write_tecplot_zone_footer(outfile, nplot);
576  }

References DIM, i, and s.

◆ output_fct() [1/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::output_fct ( std::ostream &  outfile,
const unsigned nplot,
const double time,
FiniteElement::UnsteadyExactSolutionFctPt  exact_soln_pt 
)
virtual

Output exact solution specified via function pointer at a given time and at a given number of plot points. Function prints as many components as are returned in solution Vector.

Output "exact" solution at a given time Solution is provided via function pointer. Plot at a given number of plot points. Function prints as many components as are returned in solution Vector.

Reimplemented from oomph::FiniteElement.

418  {
419  // Vector of local coordinates
420  Vector<double> s(DIM);
421 
422  // Vector for coordintes
423  Vector<double> x(DIM);
424 
425  // Tecplot header info
426  outfile << tecplot_zone_string(nplot);
427 
428  // Exact solution Vector
429  Vector<double> exact_soln;
430 
431  // Loop over plot points
432  unsigned num_plot_points = nplot_points(nplot);
433  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
434  {
435  // Get local coordinates of plot point
436  get_s_plot(iplot, nplot, s);
437 
438  // Get x position as Vector
439  interpolated_x(s, x);
440 
441  // Get exact solution at this point
442  (*exact_soln_pt)(time, x, exact_soln);
443 
444  // Output x,y,...
445  for (unsigned i = 0; i < DIM; i++)
446  {
447  outfile << x[i] << " ";
448  }
449 
450  // Output "exact solution"
451  for (unsigned i = 0; i < exact_soln.size(); i++)
452  {
453  outfile << exact_soln[i] << " ";
454  }
455 
456  outfile << std::endl;
457  }
458 
459  // Write tecplot footer (e.g. FE connectivity lists)
460  write_tecplot_zone_footer(outfile, nplot);
461  }

References DIM, ProblemParameters::exact_soln(), i, s, and plotDoE::x.

◆ output_fct() [2/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::output_fct ( std::ostream &  outfile,
const unsigned nplot,
FiniteElement::SteadyExactSolutionFctPt  exact_soln_pt 
)
virtual

Output exact solution specified via function pointer at a given number of plot points. Function prints as many components as are returned in solution Vector

Output "exact" solution Solution is provided via function pointer. Plot at a given number of plot points. Function prints as many components as are returned in solution Vector.

Reimplemented from oomph::FiniteElement.

361  {
362  // Vector of local coordinates
363  Vector<double> s(DIM);
364 
365  // Vector for coordintes
366  Vector<double> x(DIM);
367 
368  // Tecplot header info
369  outfile << tecplot_zone_string(nplot);
370 
371  // Exact solution Vector
372  Vector<double> exact_soln;
373 
374  // Loop over plot points
375  unsigned num_plot_points = nplot_points(nplot);
376  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
377  {
378  // Get local coordinates of plot point
379  get_s_plot(iplot, nplot, s);
380 
381  // Get x position as Vector
382  interpolated_x(s, x);
383 
384  // Get exact solution at this point
385  (*exact_soln_pt)(x, exact_soln);
386 
387  // Output x,y,...
388  for (unsigned i = 0; i < DIM; i++)
389  {
390  outfile << x[i] << " ";
391  }
392 
393  // Output "exact solution"
394  for (unsigned i = 0; i < exact_soln.size(); i++)
395  {
396  outfile << exact_soln[i] << " ";
397  }
398 
399  outfile << std::endl;
400  }
401 
402  // Write tecplot footer (e.g. FE connectivity lists)
403  write_tecplot_zone_footer(outfile, nplot);
404  }

References DIM, ProblemParameters::exact_soln(), i, s, and plotDoE::x.

◆ output_veloc()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::output_veloc ( std::ostream &  outfile,
const unsigned nplot,
const unsigned t 
)

Output function: x,y,[z],u,v,[w] in tecplot format. nplot points in each coordinate direction at timestep t (t=0: present; t>0: previous timestep)

Output function: Velocities only x,y,[z],u,v,[w] in tecplot format at specified previous timestep (t=0: present; t>0: previous timestep). Specified number of plot points in each coordinate direction.

473  {
474  // Find number of nodes
475  unsigned n_node = nnode();
476 
477  // Local shape function
478  Shape psi(n_node);
479 
480  // Vectors of local coordinates and coords and velocities
481  Vector<double> s(DIM);
482  Vector<double> interpolated_x(DIM);
483  Vector<double> interpolated_u(DIM);
484 
485  // Tecplot header info
486  outfile << tecplot_zone_string(nplot);
487 
488  // Loop over plot points
489  unsigned num_plot_points = nplot_points(nplot);
490  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
491  {
492  // Get local coordinates of plot point
493  get_s_plot(iplot, nplot, s);
494 
495  // Get shape functions
496  shape(s, psi);
497 
498  // Loop over directions
499  for (unsigned i = 0; i < DIM; i++)
500  {
501  interpolated_x[i] = 0.0;
502  interpolated_u[i] = 0.0;
503  // Get the index at which velocity i is stored
504  unsigned u_nodal_index = u_index_nst(i);
505  // Loop over the local nodes and sum
506  for (unsigned l = 0; l < n_node; l++)
507  {
508  interpolated_u[i] += nodal_value(t, l, u_nodal_index) * psi[l];
509  interpolated_x[i] += nodal_position(t, l, i) * psi[l];
510  }
511  }
512 
513  // Coordinates
514  for (unsigned i = 0; i < DIM; i++)
515  {
516  outfile << interpolated_x[i] << " ";
517  }
518 
519  // Velocities
520  for (unsigned i = 0; i < DIM; i++)
521  {
522  outfile << interpolated_u[i] << " ";
523  }
524 
525  outfile << std::endl;
526  }
527 
528  // Write tecplot footer (e.g. FE connectivity lists)
529  write_tecplot_zone_footer(outfile, nplot);
530  }
double nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:2317

References DIM, i, s, oomph::OneDimLagrange::shape(), and plotPSD::t.

◆ output_vorticity()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::output_vorticity ( std::ostream &  outfile,
const unsigned nplot 
)

Output function: x,y,[z], [omega_x,omega_y,[and/or omega_z]] in tecplot format. nplot points in each coordinate direction

Output function for vorticity. x,y,[z],[omega_x,omega_y,[and/or omega_z]] in tecplot format. Specified number of plot points in each coordinate direction.

764  {
765  // Vector of local coordinates
766  Vector<double> s(DIM);
767 
768  // Create vorticity vector of the required size
769  Vector<double> vorticity;
770  if (DIM == 2)
771  {
772  vorticity.resize(1);
773  }
774  else if (DIM == 3)
775  {
776  vorticity.resize(3);
777  }
778  else
779  {
780  std::string error_message =
781  "Can't output vorticity in 1D - in fact, what do you mean\n";
782  error_message += "by the 1D Navier-Stokes equations?\n";
783 
784  throw OomphLibError(
786  }
787 
788  // Tecplot header info
789  outfile << tecplot_zone_string(nplot);
790 
791  // Loop over plot points
792  unsigned num_plot_points = nplot_points(nplot);
793  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
794  {
795  // Get local coordinates of plot point
796  get_s_plot(iplot, nplot, s);
797 
798  // Coordinates
799  for (unsigned i = 0; i < DIM; i++)
800  {
801  outfile << interpolated_x(s, i) << " ";
802  }
803 
804  // Get vorticity
805  get_vorticity(s, vorticity);
806 
807  if (DIM == 2)
808  {
809  outfile << vorticity[0];
810  }
811  else
812  {
813  outfile << vorticity[0] << " " << vorticity[1] << " " << vorticity[2]
814  << " ";
815  }
816 
817  outfile << std::endl;
818  }
819  outfile << std::endl;
820 
821  // Write tecplot footer (e.g. FE connectivity lists)
822  write_tecplot_zone_footer(outfile, nplot);
823  }
void get_vorticity(const Vector< double > &s, Vector< double > &vorticity) const
Compute the vorticity vector at local coordinate s.
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References DIM, i, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, and oomph::Global_string_for_annotation::string().

◆ p_nodal_index_nst()

template<unsigned DIM>
virtual int oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::p_nodal_index_nst ( ) const
inlinevirtual

Return the index at which the pressure is stored if it is stored at the nodes. If not stored at the nodes this will return a negative number.

Implements oomph::GeneralisedNewtonianTemplateFreeNavierStokesEquationsBase.

Reimplemented in oomph::GeneralisedNewtonianTTaylorHoodElement< DIM >, and oomph::GeneralisedNewtonianQTaylorHoodElement< DIM >.

651  {
653  }
static int Pressure_not_stored_at_node
Definition: generalised_newtonian_navier_stokes_elements.h:143

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Pressure_not_stored_at_node.

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::pin_all_non_pressure_dofs().

◆ p_nst() [1/2]

◆ p_nst() [2/2]

◆ pin_all_non_pressure_dofs()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::pin_all_non_pressure_dofs ( std::map< Data *, std::vector< int >> &  eqn_number_backup)
inlinevirtual

Pin all non-pressure dofs and backup eqn numbers.

Implements oomph::GeneralisedNewtonianTemplateFreeNavierStokesEquationsBase.

1003  {
1004  // Loop over internal data and pin the values (having established that
1005  // pressure dofs aren't amongst those)
1006  unsigned nint = this->ninternal_data();
1007  for (unsigned j = 0; j < nint; j++)
1008  {
1009  Data* data_pt = this->internal_data_pt(j);
1010  if (eqn_number_backup[data_pt].size() == 0)
1011  {
1012  unsigned nvalue = data_pt->nvalue();
1013  eqn_number_backup[data_pt].resize(nvalue);
1014  for (unsigned i = 0; i < nvalue; i++)
1015  {
1016  // Backup
1017  eqn_number_backup[data_pt][i] = data_pt->eqn_number(i);
1018 
1019  // Pin everything
1020  data_pt->pin(i);
1021  }
1022  }
1023  }
1024 
1025  // Now deal with nodal values
1026  unsigned nnod = this->nnode();
1027  for (unsigned j = 0; j < nnod; j++)
1028  {
1029  Node* nod_pt = this->node_pt(j);
1030  if (eqn_number_backup[nod_pt].size() == 0)
1031  {
1032  unsigned nvalue = nod_pt->nvalue();
1033  eqn_number_backup[nod_pt].resize(nvalue);
1034  for (unsigned i = 0; i < nvalue; i++)
1035  {
1036  // Pin everything apart from the nodal pressure
1037  // value
1038  if (int(i) != this->p_nodal_index_nst())
1039  {
1040  // Backup
1041  eqn_number_backup[nod_pt][i] = nod_pt->eqn_number(i);
1042 
1043  // Pin
1044  nod_pt->pin(i);
1045  }
1046  // Else it's a pressure value
1047  else
1048  {
1049  // Exclude non-nodal pressure based elements
1050  if (this->p_nodal_index_nst() >= 0)
1051  {
1052  // Backup
1053  eqn_number_backup[nod_pt][i] = nod_pt->eqn_number(i);
1054  }
1055  }
1056  }
1057 
1058 
1059  // If it's a solid node deal with its positional data too
1060  SolidNode* solid_nod_pt = dynamic_cast<SolidNode*>(nod_pt);
1061  if (solid_nod_pt != 0)
1062  {
1063  Data* solid_posn_data_pt = solid_nod_pt->variable_position_pt();
1064  if (eqn_number_backup[solid_posn_data_pt].size() == 0)
1065  {
1066  unsigned nvalue = solid_posn_data_pt->nvalue();
1067  eqn_number_backup[solid_posn_data_pt].resize(nvalue);
1068  for (unsigned i = 0; i < nvalue; i++)
1069  {
1070  // Backup
1071  eqn_number_backup[solid_posn_data_pt][i] =
1072  solid_posn_data_pt->eqn_number(i);
1073 
1074  // Pin
1075  solid_posn_data_pt->pin(i);
1076  }
1077  }
1078  }
1079  }
1080  }
1081  }
double size() const
Definition: elements.cc:4290
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
unsigned ninternal_data() const
Return the number of internal data objects.
Definition: elements.h:823
virtual int p_nodal_index_nst() const
Definition: generalised_newtonian_navier_stokes_elements.h:650

References oomph::Data::eqn_number(), i, oomph::GeneralisedElement::internal_data_pt(), j, oomph::GeneralisedElement::ninternal_data(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::Data::nvalue(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::p_nodal_index_nst(), oomph::Data::pin(), oomph::FiniteElement::size(), and oomph::SolidNode::variable_position_pt().

◆ point_output_data()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::point_output_data ( const Vector< double > &  s,
Vector< double > &  data 
)
inlinevirtual

Output solution in data vector at local cordinates s: x,y [,z], u,v,[w], p

Reimplemented from oomph::FiniteElement.

1273  {
1274  // Dimension
1275  unsigned dim = s.size();
1276 
1277  // Resize data for values
1278  data.resize(2 * dim + 1);
1279 
1280  // Write values in the vector
1281  for (unsigned i = 0; i < dim; i++)
1282  {
1283  data[i] = interpolated_x(s, i);
1284  data[i + dim] = this->interpolated_u_nst(s, i);
1285  }
1286  data[2 * dim] = this->interpolated_p_nst(s);
1287  }
int data[]
Definition: Map_placement_new.cpp:1

References data, oomph::FiniteElement::dim(), i, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_p_nst(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_u_nst(), oomph::FiniteElement::interpolated_x(), and s.

◆ pressure_integral()

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::pressure_integral

Integral of pressure over element.

Return pressure integrated over the element.

1515  {
1516  // Initialise
1517  double press_int = 0;
1518 
1519  // Set the value of n_intpt
1520  unsigned n_intpt = integral_pt()->nweight();
1521 
1522  // Set the Vector to hold local coordinates
1523  Vector<double> s(DIM);
1524 
1525  // Loop over the integration points
1526  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
1527  {
1528  // Assign values of s
1529  for (unsigned i = 0; i < DIM; i++)
1530  {
1531  s[i] = integral_pt()->knot(ipt, i);
1532  }
1533 
1534  // Get the integral weight
1535  double w = integral_pt()->weight(ipt);
1536 
1537  // Get Jacobian of mapping
1538  double J = J_eulerian(s);
1539 
1540  // Premultiply the weights and the Jacobian
1541  double W = w * J;
1542 
1543  // Get pressure
1544  double press = interpolated_p_nst(s);
1545 
1546  // Add
1547  press_int += press * W;
1548  }
1549 
1550  return press_int;
1551  }

References DIM, i, J, s, w, and oomph::QuadTreeNames::W.

◆ pshape_nst() [1/2]

◆ pshape_nst() [2/2]

◆ re()

template<unsigned DIM>
const double& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::re ( ) const
inline

Reynolds number.

431  {
432  return *Re_pt;
433  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Re_pt.

◆ re_invfr()

template<unsigned DIM>
const double& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::re_invfr ( ) const
inline

Global inverse Froude number.

481  {
482  return *ReInvFr_pt;
483  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ReInvFr_pt.

◆ re_invfr_pt()

template<unsigned DIM>
double*& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::re_invfr_pt ( )
inline

Pointer to global inverse Froude number.

487  {
488  return ReInvFr_pt;
489  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ReInvFr_pt.

◆ re_pt()

template<unsigned DIM>
double*& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::re_pt ( )
inline

Pointer to Reynolds number.

443  {
444  return Re_pt;
445  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Re_pt.

◆ re_st()

template<unsigned DIM>
const double& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::re_st ( ) const
inline

Product of Reynolds and Strouhal number (=Womersley number)

437  {
438  return *ReSt_pt;
439  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ReSt_pt.

◆ re_st_pt()

template<unsigned DIM>
double*& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::re_st_pt ( )
inline

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

449  {
450  return ReSt_pt;
451  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ReSt_pt.

◆ scalar_name_paraview()

template<unsigned DIM>
std::string oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::scalar_name_paraview ( const unsigned i) const
inlinevirtual

Name of the i-th scalar field. Default implementation returns V1 for the first one, V2 for the second etc. Can (should!) be overloaded with more meaningful names in specific elements.

Reimplemented from oomph::FiniteElement.

810  {
811  // Velocities
812  if (i < DIM)
813  {
814  return "Velocity " + StringConversion::to_string(i);
815  }
816  // Preussre
817  else if (i == DIM)
818  {
819  return "Pressure";
820  }
821  // Never get here
822  else
823  {
824  std::stringstream error_stream;
825  error_stream << "These Navier Stokes elements only store " << DIM + 1
826  << " fields,\n"
827  << "but i is currently " << i << std::endl;
828  throw OomphLibError(
829  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
830  // Dummy return
831  return " ";
832  }
833  }
std::string to_string(T object, unsigned float_precision=8)
Definition: oomph_utilities.h:189

References DIM, i, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::StringConversion::to_string().

◆ scalar_value_paraview()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::scalar_value_paraview ( std::ofstream &  file_out,
const unsigned i,
const unsigned nplot 
) const
inlinevirtual

Write values of the i-th scalar field at the plot points. Needs to be implemented for each new specific element type.

Reimplemented from oomph::FiniteElement.

766  {
767  // Vector of local coordinates
768  Vector<double> s(DIM);
769 
770 
771  // Loop over plot points
772  unsigned num_plot_points = nplot_points_paraview(nplot);
773  for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
774  {
775  // Get local coordinates of plot point
776  get_s_plot(iplot, nplot, s);
777 
778  // Velocities
779  if (i < DIM)
780  {
781  file_out << interpolated_u_nst(s, i) << std::endl;
782  }
783 
784  // Pressure
785  else if (i == DIM)
786  {
787  file_out << interpolated_p_nst(s) << std::endl;
788  }
789 
790  // Never get here
791  else
792  {
793 #ifdef PARANOID
794  std::stringstream error_stream;
795  error_stream << "These Navier Stokes elements only store " << DIM + 1
796  << " fields, "
797  << "but i is currently " << i << std::endl;
798  throw OomphLibError(error_stream.str(),
801 #endif
802  }
803  }
804  }
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Definition: elements.h:2862

References DIM, oomph::FiniteElement::get_s_plot(), i, oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_p_nst(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::interpolated_u_nst(), oomph::FiniteElement::nplot_points_paraview(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and s.

◆ source_fct_pt() [1/2]

template<unsigned DIM>
NavierStokesSourceFctPt& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::source_fct_pt ( )
inline

Access function for the source-function pointer.

517  {
518  return Source_fct_pt;
519  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Source_fct_pt.

◆ source_fct_pt() [2/2]

template<unsigned DIM>
NavierStokesSourceFctPt oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::source_fct_pt ( ) const
inline

Access function for the source-function pointer. Const version.

523  {
524  return Source_fct_pt;
525  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Source_fct_pt.

◆ strain_rate() [1/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::strain_rate ( const unsigned t,
const Vector< double > &  s,
DenseMatrix< double > &  strainrate 
) const

Strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) at a specific time history value

Get strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) at a specific time

1086  {
1087 #ifdef PARANOID
1088  if ((strainrate.ncol() != DIM) || (strainrate.nrow() != DIM))
1089  {
1090  std::ostringstream error_message;
1091  error_message << "The strain rate has incorrect dimensions "
1092  << strainrate.ncol() << " x " << strainrate.nrow()
1093  << " Not " << DIM << std::endl;
1094 
1095  throw OomphLibError(
1096  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1097  }
1098 #endif
1099 
1100  // Velocity gradient matrix
1101  DenseMatrix<double> dudx(DIM);
1102 
1103  // Find out how many nodes there are in the element
1104  unsigned n_node = nnode();
1105 
1106  // Set up memory for the shape and test functions
1107  Shape psi(n_node);
1108  DShape dpsidx(n_node, DIM);
1109 
1110  // Loop over all nodes to back up current positions and over-write them
1111  // with the appropriate history values
1112  DenseMatrix<double> backed_up_nodal_position(n_node, DIM);
1113  for (unsigned j = 0; j < n_node; j++)
1114  {
1115  for (unsigned k = 0; k < DIM; k++)
1116  {
1117  backed_up_nodal_position(j, k) = node_pt(j)->x(k);
1118  node_pt(j)->x(k) = node_pt(j)->x(t, k);
1119  }
1120  }
1121 
1122  // Call the derivatives of the shape functions
1123  dshape_eulerian(s, psi, dpsidx);
1124 
1125  // Initialise to zero
1126  for (unsigned i = 0; i < DIM; i++)
1127  {
1128  for (unsigned j = 0; j < DIM; j++)
1129  {
1130  dudx(i, j) = 0.0;
1131  }
1132  }
1133 
1134  // Loop over veclocity components
1135  for (unsigned i = 0; i < DIM; i++)
1136  {
1137  // Get the index at which the i-th velocity is stored
1138  unsigned u_nodal_index = u_index_nst(i);
1139  // Loop over derivative directions
1140  for (unsigned j = 0; j < DIM; j++)
1141  {
1142  // Loop over nodes
1143  for (unsigned l = 0; l < n_node; l++)
1144  {
1145  dudx(i, j) += nodal_value(t, l, u_nodal_index) * dpsidx(l, j);
1146  }
1147  }
1148  }
1149 
1150  // Loop over veclocity components
1151  for (unsigned i = 0; i < DIM; i++)
1152  {
1153  // Loop over derivative directions
1154  for (unsigned j = 0; j < DIM; j++)
1155  {
1156  strainrate(i, j) = 0.5 * (dudx(i, j) + dudx(j, i));
1157  }
1158  }
1159 
1160  // Reset current nodal positions
1161  for (unsigned j = 0; j < n_node; j++)
1162  {
1163  for (unsigned k = 0; k < DIM; k++)
1164  {
1165  node_pt(j)->x(k) = backed_up_nodal_position(j, k);
1166  }
1167  }
1168  }
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060

References DIM, i, j, k, oomph::DenseMatrix< T >::ncol(), oomph::DenseMatrix< T >::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, and plotPSD::t.

◆ strain_rate() [2/2]

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::strain_rate ( const Vector< double > &  s,
DenseMatrix< double > &  strain_rate 
) const

Strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i)

Get strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i)

1014  {
1015 #ifdef PARANOID
1016  if ((strainrate.ncol() != DIM) || (strainrate.nrow() != DIM))
1017  {
1018  std::ostringstream error_message;
1019  error_message << "The strain rate has incorrect dimensions "
1020  << strainrate.ncol() << " x " << strainrate.nrow()
1021  << " Not " << DIM << std::endl;
1022 
1023  throw OomphLibError(
1024  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1025  }
1026 #endif
1027 
1028  // Velocity gradient matrix
1029  DenseMatrix<double> dudx(DIM);
1030 
1031  // Find out how many nodes there are in the element
1032  unsigned n_node = nnode();
1033 
1034  // Set up memory for the shape and test functions
1035  Shape psi(n_node);
1036  DShape dpsidx(n_node, DIM);
1037 
1038  // Call the derivatives of the shape functions
1039  dshape_eulerian(s, psi, dpsidx);
1040 
1041  // Initialise to zero
1042  for (unsigned i = 0; i < DIM; i++)
1043  {
1044  for (unsigned j = 0; j < DIM; j++)
1045  {
1046  dudx(i, j) = 0.0;
1047  }
1048  }
1049 
1050  // Loop over veclocity components
1051  for (unsigned i = 0; i < DIM; i++)
1052  {
1053  // Get the index at which the i-th velocity is stored
1054  unsigned u_nodal_index = u_index_nst(i);
1055  // Loop over derivative directions
1056  for (unsigned j = 0; j < DIM; j++)
1057  {
1058  // Loop over nodes
1059  for (unsigned l = 0; l < n_node; l++)
1060  {
1061  dudx(i, j) += nodal_value(l, u_nodal_index) * dpsidx(l, j);
1062  }
1063  }
1064  }
1065 
1066  // Loop over veclocity components
1067  for (unsigned i = 0; i < DIM; i++)
1068  {
1069  // Loop over derivative directions
1070  for (unsigned j = 0; j < DIM; j++)
1071  {
1072  strainrate(i, j) = 0.5 * (dudx(i, j) + dudx(j, i));
1073  }
1074  }
1075  }

References DIM, i, j, oomph::DenseMatrix< T >::ncol(), oomph::DenseMatrix< T >::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and s.

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::extrapolated_strain_rate(), oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >::get_Z2_flux(), oomph::GeneralisedNewtonianTCrouzeixRaviartElement< DIM >::get_Z2_flux(), and oomph::GeneralisedNewtonianTTaylorHoodElement< DIM >::get_Z2_flux().

◆ u_index_nst()

◆ u_nst() [1/2]

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_nst ( const unsigned n,
const unsigned i 
) const
inline

Velocity i at local node n. Uses suitably interpolated value for hanging nodes. The use of u_index_nst() permits the use of this element as the basis for multi-physics elements. The default is to assume that the i-th velocity component is stored at the i-th location of the node

563  {
564  return nodal_value(n, u_index_nst(i));
565  }

References i, n, oomph::FiniteElement::nodal_value(), and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_index_nst().

◆ u_nst() [2/2]

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_nst ( const unsigned t,
const unsigned n,
const unsigned i 
) const
inline

Velocity i at local node n at timestep t (t=0: present; t>0: previous). Uses suitably interpolated value for hanging nodes.

570  {
571  return nodal_value(t, n, u_index_nst(i));
572  }

References i, n, oomph::FiniteElement::nodal_value(), plotPSD::t, and oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::u_index_nst().

◆ use_current_strainrate_to_compute_second_invariant()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::use_current_strainrate_to_compute_second_invariant ( )
inline

◆ use_extrapolated_strainrate_to_compute_second_invariant()

template<unsigned DIM>
void oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::use_extrapolated_strainrate_to_compute_second_invariant ( )
inline

◆ viscosity_ratio()

template<unsigned DIM>
const double& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::viscosity_ratio ( ) const
inline

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

456  {
457  return *Viscosity_Ratio_pt;
458  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Viscosity_Ratio_pt.

◆ viscosity_ratio_pt()

template<unsigned DIM>
double*& oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::viscosity_ratio_pt ( )
inline

Pointer to Viscosity Ratio.

462  {
463  return Viscosity_Ratio_pt;
464  }

References oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Viscosity_Ratio_pt.

Member Data Documentation

◆ ALE_is_disabled

template<unsigned DIM>
bool oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::ALE_is_disabled
protected

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

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::disable_ALE(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::enable_ALE(), and oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >::further_build().

◆ Body_force_fct_pt

◆ Constitutive_eqn_pt

template<unsigned DIM>
GeneralisedNewtonianConstitutiveEquation<DIM>* oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Constitutive_eqn_pt
protected

Pointer to the generalised Newtonian constitutive equation.

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::constitutive_eqn_pt().

◆ Default_Gravity_vector

template<unsigned DIM>
Vector< double > oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Default_Gravity_vector
staticprivate

Static default value for the gravity vector.

Navier-Stokes equations default gravity vector.

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::GeneralisedNewtonianNavierStokesEquations().

◆ Default_Physical_Constant_Value

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Default_Physical_Constant_Value = 0.0
staticprivate

Navier–Stokes equations static data.

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

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::GeneralisedNewtonianNavierStokesEquations().

◆ Default_Physical_Ratio_Value

template<unsigned DIM>
double oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Default_Physical_Ratio_Value = 1.0
staticprivate

Navier–Stokes equations static data.

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

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::GeneralisedNewtonianNavierStokesEquations().

◆ Density_Ratio_pt

◆ G_pt

◆ Gamma

template<unsigned DIM>
Vector< double > oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Gamma
static

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

Navier–Stokes equations static data.

////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

◆ Pre_multiply_by_viscosity_ratio

template<unsigned DIM>
bool oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Pre_multiply_by_viscosity_ratio = false
staticprotected

Static boolean telling us whether we pre-multiply the pressure and continuity by the viscosity ratio

By default disable the pre-multiplication of the pressure and continuity equation by the viscosity ratio

◆ Pressure_not_stored_at_node

template<unsigned DIM>
int oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::Pressure_not_stored_at_node = -100
staticprivate

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

"Magic" negative number that indicates that the pressure is not stored at a node. This cannot be -1 because that represents the positional hanging scheme in the hanging_pt object of nodes

Referenced by oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::p_nodal_index_nst().

◆ Re_pt

◆ ReInvFr_pt

◆ ReSt_pt

◆ Source_fct_pt

◆ Use_extrapolated_strainrate_to_compute_second_invariant

◆ Viscosity_Ratio_pt


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