GRINS-0.7.0
averaged_turbine_base.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 #ifndef GRINS_AVERAGED_TURBINE_BASE_H
27 #define GRINS_AVERAGED_TURBINE_BASE_H
28 
29 // GRINS
30 #include "grins_config.h"
32 
33 // libMesh
34 #include "libmesh/getpot.h"
35 #include "libmesh/parsed_function.h"
36 #include "libmesh/tensor_value.h"
37 
38 // C++
39 #include <string>
40 
41 namespace GRINS
42 {
43 
44  template<class Viscosity>
46  {
47  public:
48 
49  AveragedTurbineBase( const std::string& physics_name, const GetPot& input );
50 
52 
54 
58  virtual void init_variables( libMesh::FEMSystem* system );
59 
61  virtual void set_time_evolving_vars( libMesh::FEMSystem* system );
62 
63  bool compute_force ( const libMesh::Point& point,
64  const libMesh::Real time,
65  const libMesh::NumberVectorValue& U,
66  libMesh::Number s,
67  libMesh::NumberVectorValue& U_B_1,
68  libMesh::NumberVectorValue& F,
69  libMesh::NumberTensorValue *dFdU = NULL,
70  libMesh::NumberVectorValue *dFds = NULL);
71 
73 
74  protected:
75 
76  // ``Base'' velocity of the moving fan blades as a function of x,y,z
77  //
78  // This velocity will be scaled by the fan_speed variable
79  // during the simulation; values in base_velocity_function should
80  // therefore correspond to a fan speed of 1 radian per second.
81  // Iff there are no fan blades moving past a location, the
82  // base velocity there is specified as zero.
84 
85  // "Up" direction of fan airflow, as a function of x,y,z
86  // For most fans this will be a constant, the axis of rotation.
88 
89  // Coefficients of lift and drag as a function of angle "t" in
90  // radians. Should be well defined on [-pi, pi].
91  //
92  // No, "t" is not time in these functions.
93  // Yes, I'm abusing FunctionBase.
96 
97  // Mechanical driving torque function (*including* non-fluid
98  // friction losses!) on the turbine (signed, measured in
99  // Newton-meters) as a function of angular velocity turbine speed
100  // "t" (measured in rad/s).
101  //
102  // Should probably be carefully defined for t>0 and t<0 to avoid
103  // potential unstable startup.
104  //
105  // Should theoretically be useable as power input (same sign as t)
106  // to model propeller fans or output (opposite sign from t) to
107  // model turbine fans.
108  //
109  // No, "t" is not time or angle of attack in this function.
110  // Yes, I'm really abusing FunctionBase.
112 
113  // Moment of inertia of the spinning component of the turbine
114  // (measured in kg-m^2)
115  libMesh::Number moment_of_inertia;
116 
117  // Initial speed of the spinning component of the turbine
118  // (measured in rad/s)
119  libMesh::Number initial_speed;
120 
121  // The chord length of the fan wing cross-section. For fan blades
122  // with constant cross-section this will be a constant.
124 
125  // The area swept out by the local fan wing cross-section. For
126  // cylindrical areas swept out by N fan blades, this is just
127  // pi*r^2*h/N
129 
130  // The angle-of-attack between the fan wing chord line and the fan
131  // velocity vector, in radians. For fan blades with no "twist"
132  // this will be a constant.
134 
135  VariableIndex _fan_speed_var; /* Index for turbine speed scalar */
136 
137  std::string _fan_speed_var_name;
138 
139  private:
140 
142  void read_input_options( const GetPot& input );
143 
145  };
146 
147 } // end namespace block
148 
149 #endif // GRINS_AVERAGED_TURBINE_BASE_H
libMesh::ParsedFunction< libMesh::Number > area_swept_function
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets turbine_speed and velocity variables to be time-evolving.
virtual void init_variables(libMesh::FEMSystem *system)
Initialization of variables.
libMesh::ParsedFunction< libMesh::Number > base_velocity_function
Physics class for Incompressible Navier-Stokes.
libMesh::ParsedFunction< libMesh::Number > aoa_function
libMesh::ParsedFunction< libMesh::Number > torque_function
GRINS namespace.
libMesh::ParsedFunction< libMesh::Number > local_vertical_function
libMesh::ParsedFunction< libMesh::Number > drag_function
libMesh::ParsedFunction< libMesh::Number > lift_function
bool compute_force(const libMesh::Point &point, const libMesh::Real time, const libMesh::NumberVectorValue &U, libMesh::Number s, libMesh::NumberVectorValue &U_B_1, libMesh::NumberVectorValue &F, libMesh::NumberTensorValue *dFdU=NULL, libMesh::NumberVectorValue *dFds=NULL)
VariableIndex fan_speed_var() const
void read_input_options(const GetPot &input)
Read options from GetPot input file.
libMesh::ParsedFunction< libMesh::Number > chord_function

Generated on Thu Jun 2 2016 21:52:27 for GRINS-0.7.0 by  doxygen 1.8.10