GRINS-0.6.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-2015 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/function_base.h"
35 #include "libmesh/getpot.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 
64  virtual void read_input_options( const GetPot& input );
65 
66  bool compute_force ( const libMesh::Point& point,
67  const libMesh::Real time,
68  const libMesh::NumberVectorValue& U,
69  libMesh::Number s,
70  libMesh::NumberVectorValue& U_B_1,
71  libMesh::NumberVectorValue& F,
72  libMesh::NumberTensorValue *dFdU = NULL,
73  libMesh::NumberVectorValue *dFds = NULL);
74 
76 
77  protected:
78 
79  // ``Base'' velocity of the moving fan blades as a function of x,y,z
80  //
81  // This velocity will be scaled by the fan_speed variable
82  // during the simulation; values in base_velocity_function should
83  // therefore correspond to a fan speed of 1 radian per second.
84  // Iff there are no fan blades moving past a location, the
85  // base velocity there is specified as zero.
86  libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > base_velocity_function;
87 
88  // "Up" direction of fan airflow, as a function of x,y,z
89  // For most fans this will be a constant, the axis of rotation.
90  libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > local_vertical_function;
91 
92  // Coefficients of lift and drag as a function of angle "t" in
93  // radians. Should be well defined on [-pi, pi].
94  //
95  // No, "t" is not time in these functions.
96  // Yes, I'm abusing FunctionBase.
97  libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > lift_function;
98  libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > drag_function;
99 
100  // Mechanical driving torque function (*including* non-fluid
101  // friction losses!) on the turbine (signed, measured in
102  // Newton-meters) as a function of angular velocity turbine speed
103  // "t" (measured in rad/s).
104  //
105  // Should probably be carefully defined for t>0 and t<0 to avoid
106  // potential unstable startup.
107  //
108  // Should theoretically be useable as power input (same sign as t)
109  // to model propeller fans or output (opposite sign from t) to
110  // model turbine fans.
111  //
112  // No, "t" is not time or angle of attack in this function.
113  // Yes, I'm really abusing FunctionBase.
114  libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > torque_function;
115 
116  // Moment of inertia of the spinning component of the turbine
117  // (measured in kg-m^2)
118  libMesh::Number moment_of_inertia;
119 
120  // Initial speed of the spinning component of the turbine
121  // (measured in rad/s)
122  libMesh::Number initial_speed;
123 
124  // The chord length of the fan wing cross-section. For fan blades
125  // with constant cross-section this will be a constant.
126  libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > chord_function;
127 
128  // The area swept out by the local fan wing cross-section. For
129  // cylindrical areas swept out by N fan blades, this is just
130  // pi*r^2*h/N
131  libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > area_swept_function;
132 
133  // The angle-of-attack between the fan wing chord line and the fan
134  // velocity vector, in radians. For fan blades with no "twist"
135  // this will be a constant.
136  libMesh::AutoPtr<libMesh::FunctionBase<libMesh::Number> > aoa_function;
137 
138  VariableIndex _fan_speed_var; /* Index for turbine speed scalar */
139 
140  std::string _fan_speed_var_name;
141 
142  private:
143 
145  };
146 
147 } // end namespace block
148 
149 #endif // GRINS_AVERAGED_TURBINE_BASE_H
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:40
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.
Physics class for Incompressible Navier-Stokes.
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > torque_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > drag_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > aoa_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > area_swept_function
GRINS namespace.
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > chord_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > local_vertical_function
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > base_velocity_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
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > lift_function
virtual void read_input_options(const GetPot &input)
Read options from GetPot input file.

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1