NonIsothermalAxisymmetricQCrouzeixRaviartElement Class Reference

#include <non_isothermal_axisym_nst_elements.h>

+ Inheritance diagram for NonIsothermalAxisymmetricQCrouzeixRaviartElement:

Public Types

typedef void(* ViscosityRatioFctPt) (double &temperature, double &result)
 

Public Member Functions

 NonIsothermalAxisymmetricQCrouzeixRaviartElement ()
 
unsigned required_nvalue (const unsigned &n) const
 
void output (ostream &outfile)
 Overload the standard output function with the broken default. More...
 
void output (ostream &outfile, const unsigned &nplot)
 
void output (FILE *file_pt)
 C-style output function: Broken default. More...
 
void output (FILE *file_pt, const unsigned &n_plot)
 C-style output function: Broken default. More...
 
void output_fct (ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
 Output function for an exact solution: Broken default. More...
 
unsigned u_index_axisym_adv_diff () const
 
void compute_error (ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
ViscosityRatioFctPtviscosity_ratio_fct_pt ()
 Access function: Pointer to viscosity ratio function. More...
 
ViscosityRatioFctPt viscosity_ratio_fct_pt () const
 Access function: Pointer to viscosity ratio function. Const version. More...
 
virtual void get_viscosity_ratio_axisym_nst (const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, double &visco)
 
void get_wind_axisym_adv_diff (const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 

Private Attributes

ViscosityRatioFctPt Viscosity_ratio_fct_pt
 

Detailed Description

A class that solves the nonisothermal melt spinning problem using the axisymmetric Navier–Stokes and energy equations by coupling two pre- existing classes. The QSteadyAxisymAdvectionDiffusionElement<Nnode1d> with bi-quadratic interpolation for the scalar variable (temperature) and QCrouzeixRaviartElement which solves the Navier–Stokes equations using bi-quadratic interpolation for the velocities and a discontinuous bi-linear interpolation for the pressure. Note that we are free to choose the order in which we store the variables at the nodes. In this case we choose to store the variables in the order fluid velocities followed by temperature. We must, therefore, overload the function AxisymAdvectionDiffusionEquations::u_index_axisym_adv_diff() to indicate that the temperature is stored at the 3-th position not the 0-th. We do not need to overload the corresponding function in the AxisymmetricNavierStokesEquations class because the velocities are stored first.

Member Typedef Documentation

◆ ViscosityRatioFctPt

typedef void(* NonIsothermalAxisymmetricQCrouzeixRaviartElement::ViscosityRatioFctPt) (double &temperature, double &result)

Function pointer to the function that specifies the viscosity ratio as function of the temperature.

Constructor & Destructor Documentation

◆ NonIsothermalAxisymmetricQCrouzeixRaviartElement()

NonIsothermalAxisymmetricQCrouzeixRaviartElement::NonIsothermalAxisymmetricQCrouzeixRaviartElement ( )
inline

Constructor: call the QSteadyAxisymAdvectionDiffusionElement and AxisymmetricQCrouzeixRaviartElement

Member Function Documentation

◆ compute_error()

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::compute_error ( ostream &  outfile,
FiniteElement::SteadyExactSolutionFctPt  exact_soln_pt,
double error,
double norm 
)
inline

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 Call the broken default

162  {
163  FiniteElement::compute_error(outfile,exact_soln_pt,error,norm);
164  }
int error
Definition: calibrate.py:297
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.

References oomph::compute_error(), and calibrate::error.

◆ fill_in_contribution_to_jacobian()

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inline

Compute the element's residual vector and the Jacobian matrix. Jacobian is computed by finite-differencing.

248  {
249  // This function computes the Jacobian by finite-differencing
251  }
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: gen_axisym_advection_diffusion_elements.h:536

References oomph::fill_in_contribution_to_jacobian().

◆ fill_in_contribution_to_residuals()

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inline

Calculate the element's contribution to the residual vector. Recall that fill_in_* functions MUST NOT initialise the entries in the vector to zero. This allows us to call the fill_in_* functions of the constituent single-physics elements sequentially, without wiping out any previously computed entries.

230  {
231  //Fill in the residuals of the Navier-Stokes equations
233 
234  //Fill in the residuals of the advection-diffusion eqautions
236  }
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector (wrapper)
Definition: gen_axisym_advection_diffusion_elements.h:522

References oomph::fill_in_contribution_to_residuals().

◆ get_viscosity_ratio_axisym_nst()

virtual void NonIsothermalAxisymmetricQCrouzeixRaviartElement::get_viscosity_ratio_axisym_nst ( const unsigned ipt,
const Vector< double > &  s,
const Vector< double > &  x,
double visco 
)
inlinevirtual

Overload the viscosity ratio in the Navier-Stokes equations This provides the coupling from axisymmetric advection-diffusion equations to the Axisymmetric Navier–Stokes equations.

182  {
183  //If the function pointer is zero return zero
184  if (Viscosity_ratio_fct_pt == 0)
185  {
186  visco = *Viscosity_Ratio_pt;
187  }
188  //Otherwise call the function
189  else
190  {
191  //Get the temperature
192  double interpolated_t = this->interpolated_u_adv_diff(s);
193 
194  // Valuate viscosity ratio
195  (*Viscosity_ratio_fct_pt)(interpolated_t,visco);
196  }
197 
198 /* //Get the temperature */
199 /* const double interpolated_t = this->interpolated_u_adv_diff(s); */
200 
201 
202 /* // Parameters that modeling the viscosity */
203 /* double G = 1.0; */
204 /* double eta = 0.0; */
205 
206 /* visco = G*exp(eta*(1.0-interpolated_t)); */
207 
208  } // end of get_visco_axisym_nst
RealScalar s
Definition: level1_cplx_impl.h:130

References s, and Viscosity_ratio_fct_pt.

◆ get_wind_axisym_adv_diff()

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::get_wind_axisym_adv_diff ( const unsigned ipt,
const Vector< double > &  s,
const Vector< double > &  x,
Vector< double > &  wind 
) const
inline

Overload the wind function in the advection-diffusion equations. This provides the coupling from the Navier–Stokes equations to the advection-diffusion equations because the wind is the fluid velocity.

219  {
220  //The wind function is simply the velocity at the points
221  this->interpolated_u_axi_nst(s,wind);
222  } // end of get_wind_axisym_adv_diff

References s.

◆ output() [1/4]

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::output ( FILE *  file_pt)
inline

C-style output function: Broken default.

128  {
129  FiniteElement::output(file_pt);
130  }
void output(std::ostream &outfile, const unsigned &nplot)
Overload output function.
Definition: overloaded_element_body.h:490

References output().

◆ output() [2/4]

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::output ( FILE *  file_pt,
const unsigned n_plot 
)
inline

C-style output function: Broken default.

134  {
135  FiniteElement::output(file_pt,n_plot);
136  }

References output().

◆ output() [3/4]

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::output ( ostream &  outfile)
inline

Overload the standard output function with the broken default.

79  {
80  FiniteElement::output(outfile);
81  }

References output().

◆ output() [4/4]

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::output ( ostream &  outfile,
const unsigned nplot 
)
inline

Output function:
Output r, z, u, w, v, p, theta at Nplot^2 plot points

87  {
88  //vector of local coordinates
89  Vector<double> s(2);
90 
91  // Tecplot header info
92  outfile << this->tecplot_zone_string(nplot);
93 
94  // Loop over plot points
95  unsigned num_plot_points=this->nplot_points(nplot);
96  for (unsigned iplot=0;iplot<num_plot_points;iplot++)
97  {
98  // Get local coordinates of plot point
99  this->get_s_plot(iplot,nplot,s);
100 
101  // Output the position (r,z) of the plot point
102  for(unsigned i=0;i<2;i++)
103  {
104  outfile << this->interpolated_x(s,i) << " ";
105  }
106 
107  // Output the fluid velocities (u,w,v) at the plot point
108  for(unsigned i=0;i<3;i++)
109  {
110  outfile << this->interpolated_u_axi_nst(s,i) << " ";
111  }
112 
113  // Output the fluid pressure at the plot point
114  outfile << this->interpolated_p_axi_nst(s) << " ";
115 
116  // Output the temperature (the advected variable) at the plot point
117  outfile << this->interpolated_u_adv_diff(s) << std::endl;
118  }
119  outfile << std::endl;
120 
121  // Write tecplot footer (e.g. FE connectivity lists)
122  this->write_tecplot_zone_footer(outfile,nplot);
123  } //End of output function
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References i, and s.

◆ output_fct()

void NonIsothermalAxisymmetricQCrouzeixRaviartElement::output_fct ( ostream &  outfile,
const unsigned Nplot,
FiniteElement::SteadyExactSolutionFctPt  exact_soln_pt 
)
inline

Output function for an exact solution: Broken default.

142  {
143  FiniteElement::output_fct(outfile,Nplot,exact_soln_pt);
144  }
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: r,z,u_exact at nplot^2 plot points.

References oomph::output_fct().

◆ required_nvalue()

unsigned NonIsothermalAxisymmetricQCrouzeixRaviartElement::required_nvalue ( const unsigned n) const
inline

The required number of values stored at the nodes is the sum of the required values of the two single-physics elements. Note that this step is generic for any multi-physics element of this type.

72  {
74  AxisymmetricQCrouzeixRaviartElement::required_nvalue(n) );
75  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11

References n.

◆ u_index_axisym_adv_diff()

unsigned NonIsothermalAxisymmetricQCrouzeixRaviartElement::u_index_axisym_adv_diff ( ) const
inline

Overload the index at which the temperature variable is stored. We choose to store it after the fluid velocities.

150  {
151  return 3;
152  }

◆ viscosity_ratio_fct_pt() [1/2]

ViscosityRatioFctPt& NonIsothermalAxisymmetricQCrouzeixRaviartElement::viscosity_ratio_fct_pt ( )
inline

Access function: Pointer to viscosity ratio function.

168 {return Viscosity_ratio_fct_pt;}

References Viscosity_ratio_fct_pt.

◆ viscosity_ratio_fct_pt() [2/2]

ViscosityRatioFctPt NonIsothermalAxisymmetricQCrouzeixRaviartElement::viscosity_ratio_fct_pt ( ) const
inline

Access function: Pointer to viscosity ratio function. Const version.

172  {return Viscosity_ratio_fct_pt;}

References Viscosity_ratio_fct_pt.

Member Data Documentation

◆ Viscosity_ratio_fct_pt

ViscosityRatioFctPt NonIsothermalAxisymmetricQCrouzeixRaviartElement::Viscosity_ratio_fct_pt
private

Function pointer to the function that specifies the viscosity ratio as a function of the temperature

Referenced by get_viscosity_ratio_axisym_nst(), and viscosity_ratio_fct_pt().


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