MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
ug_flutter_solver.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef __mast__ug_flutter_solver_h__
21 #define __mast__ug_flutter_solver_h__
22 
23 // C++ includes
24 #include <memory>
25 
26 
27 // MAST includes
29 
30 
31 namespace MAST {
32 
33  // Forward declerations
34  class Parameter;
35 
43 
44  public:
45 
50 
51 
52  virtual ~UGFlutterSolver();
53 
54 
55 
59  void clear();
60 
61 
65  virtual void clear_solutions();
66 
67 
71  void initialize(MAST::Parameter& kr_param,
72  MAST::Parameter& bref_param,
73  Real rho,
74  Real kr_lower,
75  Real kr_upper,
76  unsigned int n_kr_divs,
77  std::vector<libMesh::NumericVector<Real>*>& basis);
78 
79 
80 
85  virtual unsigned int n_roots_found() const;
86 
87 
92  const MAST::FlutterRootBase& get_root(const unsigned int n) const;
93 
94 
102  virtual std::pair<bool, MAST::FlutterRootBase*>
103  find_next_root(const Real g_tol,
104  const unsigned int n_bisection_iters);
105 
106 
107 
113  virtual std::pair<bool, MAST::FlutterRootBase*>
114  find_critical_root(const Real g_tol,
115  const unsigned int n_bisection_iters);
116 
117 
128  virtual void
130  const MAST::FunctionBase& f,
131  libMesh::NumericVector<Real>* dXdp = nullptr,
132  libMesh::NumericVector<Real>* dXdkr = nullptr);
133 
134 
138  virtual void print_sorted_roots();
139 
140 
145  virtual void print_crossover_points();
146 
147 
153  virtual void scan_for_roots();
154 
155 
156  protected:
157 
158 
164  virtual std::unique_ptr<MAST::FlutterSolutionBase>
165  _analyze(const Real kr_ref,
166  const MAST::FlutterSolutionBase* prev_sol=nullptr);
167 
168 
169 
173  virtual std::pair<bool, MAST::FlutterSolutionBase*>
175  MAST::FlutterSolutionBase*>& ref_sol_range,
176  const unsigned int root_num,
177  const Real g_tol,
178  const unsigned int max_iters);
179 
180 
185  void _initialize_matrices(Real kr,
186  ComplexMatrixX& A,
187  ComplexMatrixX& B);
188 
189 
194  void
196  const libMesh::NumericVector<Real>& dXdp,
197  Real kr,
198  ComplexMatrixX& A,
199  ComplexMatrixX& B);
200 
201 
205  void
207  ComplexMatrixX& A,
208  ComplexMatrixX& B);
209 
210 
215  virtual void _identify_crossover_points();
216 
217 
222 
223 
228 
229 
234 
235 
239  std::pair<Real, Real> _kr_range;
240 
241 
246  unsigned int _n_kr_divs;
247 
248 
252  std::map<Real, MAST::FlutterSolutionBase*> _flutter_solutions;
253 
254 
260 
265  std::multimap<Real, MAST::FlutterRootCrossoverBase*> _flutter_crossovers;
266 
267  };
268 }
269 
270 
271 #endif // __mast__ug_flutter_solver_h__
unsigned int _n_kr_divs
number of division in the reference value range for initial scanning
virtual void print_sorted_roots()
Prints the sorted roots to the output.
virtual std::pair< bool, MAST::FlutterSolutionBase * > _bisection_search(const std::pair< MAST::FlutterSolutionBase *, MAST::FlutterSolutionBase *> &ref_sol_range, const unsigned int root_num, const Real g_tol, const unsigned int max_iters)
bisection method search
This is a scalar function whose value can be changed and one that can be used as a design variable in...
Definition: parameter.h:35
virtual unsigned int n_roots_found() const
finds the number of critical points already identified in the procedure.
libMesh::Real Real
virtual std::pair< bool, MAST::FlutterRootBase * > find_critical_root(const Real g_tol, const unsigned int n_bisection_iters)
This method checks if the flutter root corresponding to the lowest velocity crossover has been calcul...
virtual void print_crossover_points()
Prints the crossover points output.
Matrix< Complex, Dynamic, Dynamic > ComplexMatrixX
bool _include_highest_kr_unstable
flag allows check to see if the root started out as critical at the highest k value.
virtual void calculate_sensitivity(MAST::FlutterRootBase &root, const MAST::FunctionBase &f, libMesh::NumericVector< Real > *dXdp=nullptr, libMesh::NumericVector< Real > *dXdkr=nullptr)
Calculate the sensitivity of the flutter root with respect to the f parameter.
std::pair< Real, Real > _kr_range
range of reference values within which to find flutter roots
void _initialize_matrix_sensitivity_for_param(const MAST::FunctionBase &f, const libMesh::NumericVector< Real > &dXdp, Real kr, ComplexMatrixX &A, ComplexMatrixX &B)
Assembles the reduced order system structural and aerodynmaic matrices for specified flight velocity ...
void _initialize_matrices(Real kr, ComplexMatrixX &A, ComplexMatrixX &B)
Assembles the reduced order system structural and aerodynmaic matrices for specified reduced freq kr...
virtual void scan_for_roots()
Scans for flutter roots in the analyzed points, and identified the divergence (if k_red = 0...
std::multimap< Real, MAST::FlutterRootCrossoverBase * > _flutter_crossovers
the map of flutter crossover points versus average kr of the two bounding roots
const MAST::FlutterRootBase & get_root(const unsigned int n) const
returns the n th root in terms of ascending velocity that is found by the solver
void _initialize_matrix_sensitivity_for_kr(Real kr, ComplexMatrixX &A, ComplexMatrixX &B)
Assembles the sensitivity of matrices wrt kr.
MAST::Parameter * _bref_param
reference chord
MAST::Parameter * _kr_param
Parameter that define the reduced frequency.
Real _rho
flight density
virtual void _identify_crossover_points()
identifies all cross-over and divergence points from analyzed roots
std::map< Real, MAST::FlutterSolutionBase * > _flutter_solutions
map of kr sorted flutter solutions
virtual std::unique_ptr< MAST::FlutterSolutionBase > _analyze(const Real kr_ref, const MAST::FlutterSolutionBase *prev_sol=nullptr)
performs an eigensolution at the specified reference value, and sort the roots based on the provided ...
void initialize(MAST::Parameter &kr_param, MAST::Parameter &bref_param, Real rho, Real kr_lower, Real kr_upper, unsigned int n_kr_divs, std::vector< libMesh::NumericVector< Real > *> &basis)
initializes the data structres for a flutter solution.
UGFlutterSolver()
defalut constructor
void clear()
clears the solution and other data from this solver
virtual void clear_solutions()
clears the solutions stored from a previous analysis.
This implements a solver for a single parameter instability problem, for example a flutter solver whe...
virtual std::pair< bool, MAST::FlutterRootBase * > find_next_root(const Real g_tol, const unsigned int n_bisection_iters)
Looks through the list of flutter cross-over points and iteratively zooms in to find the cross-over p...