CppNoddy  0.92
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Attributes | List of all members
CppNoddy::HST::Orr_Sommerfeld Class Reference

#include <HST.h>

Public Member Functions

 Orr_Sommerfeld (OneD_Node_Mesh< double > &base_flow_solution, double alpha, double rey)
 ctor More...
 
void global_evp ()
 Solve the global eigenvalue problem for the Rayleigh equation. More...
 
void local_evp (std::size_t i_ev)
 Solve the EVP locally as a nonlinear BVP for just one mode. More...
 
void remesh1 (const OneD_Node_Mesh< double > &new_baseflow)
 Refine the EIGENVECTORS mesh for a new baseflow. More...
 
OneD_Node_Mesh< std::complex< double > > & eigenvectors ()
 A handle to the eigenvectors mesh. More...
 
void iterate_to_neutral (std::size_t i_ev)
 Iterate on the wavenumber ALPHA, using the local_evp routine, to drive a selected eigenvalue to be neutral (ie. More...
 
DenseVector< std::complex< double > > & eigenvalues ()
 A handle to the eigenvalues vector. More...
 
double & alpha ()
 A handle to the wavenumber. More...
 

Protected Attributes

double RE
 
double ALPHA
 
OneD_Node_Mesh< double > BASEFLOW
 
OneD_Node_Mesh< std::complex< double > > EIGENVECTORS
 
DenseVector< std::complex< double > > EIGENVALUES
 

Detailed Description

Definition at line 156 of file HST.h.

Constructor & Destructor Documentation

◆ Orr_Sommerfeld()

CppNoddy::HST::Orr_Sommerfeld::Orr_Sommerfeld ( OneD_Node_Mesh< double > &  base_flow_solution,
double  alpha,
double  rey 
)
inline

ctor

Parameters
base_flow_solutionThe base flow velocity profile and its curvature.
alphaThe wavenumber to compute the spectrum for.
reyThe Reynolds number to compute the spectrum for.

Definition at line 221 of file HST.h.

221 {
222 ALPHA = alpha;
223 RE = rey;
224 BASEFLOW = base_flow_solution;
225 }
OneD_Node_Mesh< double > BASEFLOW
Definition: HST.h:320
double & alpha()
A handle to the wavenumber.
Definition: HST.h:312

References alpha(), ALPHA, BASEFLOW, and RE.

Member Function Documentation

◆ alpha()

double & CppNoddy::HST::Orr_Sommerfeld::alpha ( )
inline

A handle to the wavenumber.

Returns
The wavenumber

Definition at line 312 of file HST.h.

312 {
313 return ALPHA;
314 }

References ALPHA.

Referenced by Orr_Sommerfeld().

◆ eigenvalues()

DenseVector< std::complex< double > > & CppNoddy::HST::Orr_Sommerfeld::eigenvalues ( )
inline

A handle to the eigenvalues vector.

Returns
A vector of eigenvalues

Definition at line 306 of file HST.h.

306 {
307 return EIGENVALUES;
308 }
DenseVector< std::complex< double > > EIGENVALUES
Definition: HST.h:322

References EIGENVALUES.

◆ eigenvectors()

OneD_Node_Mesh< std::complex< double > > & CppNoddy::HST::Orr_Sommerfeld::eigenvectors ( )
inline

A handle to the eigenvectors mesh.

Returns
A mesh containing the eigenvectors, with the i-th variable corresponding to the i-th eigenvalue.

Definition at line 294 of file HST.h.

294 {
295 return EIGENVECTORS;
296 }
OneD_Node_Mesh< std::complex< double > > EIGENVECTORS
Definition: HST.h:321

References EIGENVECTORS.

◆ global_evp()

void CppNoddy::HST::Orr_Sommerfeld::global_evp ( )
inline

Solve the global eigenvalue problem for the Rayleigh equation.

Definition at line 228 of file HST.h.

228 {
229 const std::complex<double> I(0.0, 1.0);
230 unsigned N(2 * BASEFLOW.get_nnodes());
231 // matrices for the EVP, initialised with zeroes
232 DenseMatrix<D_complex> a(N, N, 0.0);
233 DenseMatrix<D_complex> b(N, N, 0.0);
234 //
235 double d = BASEFLOW.coord(1) - BASEFLOW.coord(0);
236 // boundary conditions at the left boundary
237 a(0, 0) = 1.0; // phi( left ) = 0
238 a(1, 0) = -1.5 / d; // phi'( left ) = 0
239 a(1, 2) = 2.0 / d;
240 a(1, 4) = -0.5 / d;
241 // fill the interior nodes
242 for(std::size_t i = 1; i <= BASEFLOW.get_nnodes() - 2; ++i) {
243 // position in the channel
244 //const double y = BASEFLOW.coord( i );
245 // base flow profile
246 const double U = BASEFLOW(i,0);
247 // BASEFLOW.get_interpolated_vars( y )[ 0 ];
248 const double Udd = (BASEFLOW(i+1,0) - 2*BASEFLOW(i,0) + BASEFLOW(i-1,0))/(d*d);
249 //BASEFLOW.get_interpolated_vars( y )[ 1 ];
250
251 // the first quation at the i'th nodal point
252 std::size_t row = 2 * i;
253 a(row, row) = -2.0 / (d * d) - ALPHA * ALPHA;
254 a(row, row - 2) = 1.0 / (d * d);
255 a(row, row + 2) = 1.0 / (d * d);
256 a(row, row + 1) = -1.0;
257
258 row += 1;
259 // the second equation at the i'th nodal point
260 a(row, row) = -2.0 / (d * d) - ALPHA * ALPHA - I * ALPHA * RE * U;
261 a(row, row - 2) = 1.0 / (d * d);
262 a(row, row + 2) = 1.0 / (d * d);
263 a(row, row - 1) = I * ALPHA * RE * Udd;
264
265 b(row, row) = - I * ALPHA * RE;
266 }
267 // boundary conditions at right boundary
268 a(N - 2, N - 2) = 1.5 / d;
269 a(N - 2, N - 4) = -2.0 / d;
270 a(N - 2, N - 6) = 0.5 / d; // psi'( right ) = 0
271 a(N - 1, N - 2) = 1.0; // psi( right ) = 0
272 // a vector for the eigenvalues
273 DenseLinearEigenSystem<D_complex> system(&a, &b);
274 system.eigensolve();
275 system.tag_eigenvalues_disc(+1, 100.0);
276 EIGENVALUES = system.get_tagged_eigenvalues();
277
278 }
@ U
Definition: BVPKarman.cpp:20
const _Xtype & coord(const std::size_t &node) const
Access a nodal position.
std::size_t get_nnodes() const
double Udd(double y)
Globally define the base flow curvature.

References ALPHA, BASEFLOW, CppNoddy::OneD_Node_Mesh< _Type, _Xtype >::coord(), CppNoddy::DenseLinearEigenSystem< _Type >::eigensolve(), EIGENVALUES, CppNoddy::OneD_Node_Mesh< _Type, _Xtype >::get_nnodes(), CppNoddy::DenseLinearEigenSystem< _Type >::get_tagged_eigenvalues(), RE, CppNoddy::DenseLinearEigenSystem< _Type >::tag_eigenvalues_disc(), and U.

◆ iterate_to_neutral()

void CppNoddy::HST::Orr_Sommerfeld::iterate_to_neutral ( std::size_t  i_ev)
inline

Iterate on the wavenumber ALPHA, using the local_evp routine, to drive a selected eigenvalue to be neutral (ie.

imaginary part is zero)

Parameters
i_evThe index of the eigenvalue to iterate on

Definition at line 302 of file HST.h.

302{}

◆ local_evp()

void CppNoddy::HST::Orr_Sommerfeld::local_evp ( std::size_t  i_ev)
inline

Solve the EVP locally as a nonlinear BVP for just one mode.

Parameters
i_evThe index of the eigenvalue to solve for, based on the return from the global_evp method.

Definition at line 283 of file HST.h.

283{}

◆ remesh1()

void CppNoddy::HST::Orr_Sommerfeld::remesh1 ( const OneD_Node_Mesh< double > &  new_baseflow)
inline

Refine the EIGENVECTORS mesh for a new baseflow.

Useful following a global_evp solve and prior to a local_evp solve.

Parameters
new_baseflowA new mesh containing the base flow, we'll linearly interpolate to this mesh

Definition at line 289 of file HST.h.

289{}

Member Data Documentation

◆ ALPHA

double CppNoddy::HST::Orr_Sommerfeld::ALPHA
protected

Definition at line 319 of file HST.h.

Referenced by alpha(), global_evp(), and Orr_Sommerfeld().

◆ BASEFLOW

OneD_Node_Mesh<double > CppNoddy::HST::Orr_Sommerfeld::BASEFLOW
protected

Definition at line 320 of file HST.h.

Referenced by global_evp(), and Orr_Sommerfeld().

◆ EIGENVALUES

DenseVector<std::complex<double> > CppNoddy::HST::Orr_Sommerfeld::EIGENVALUES
protected

Definition at line 322 of file HST.h.

Referenced by eigenvalues(), and global_evp().

◆ EIGENVECTORS

OneD_Node_Mesh<std::complex<double> > CppNoddy::HST::Orr_Sommerfeld::EIGENVECTORS
protected

Definition at line 321 of file HST.h.

Referenced by eigenvectors().

◆ RE

double CppNoddy::HST::Orr_Sommerfeld::RE
protected

Definition at line 318 of file HST.h.

Referenced by global_evp(), and Orr_Sommerfeld().


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

© 2012

R.E. Hewitt