MAST
flight_condition.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2019 Manav Bhatia
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_fluid_condition_h__
21 #define __mast_fluid_condition_h__
22 
23 // MAST includes
24 #include "base/mast_data_types.h"
25 #include "fluid/gas_property.h"
27 
28 
29 // Eigen includes
30 #include "Eigen/Core"
31 
32 namespace MAST {
33 
35 
36  public:
39  flow_unit_vector (RealVectorX::Zero(3)),
40  mach (0.),
41  ref_chord (0.)
42  {}
43 
44  virtual ~FlightCondition()
45  {}
46 
53 
58 
63 
68 
73 
77  Real velocity_magnitude() const {return mach * gas_property.a;}
78 
82  Real q0() const
83  {
84  return 0.5 * gas_property.rho * pow(velocity_magnitude(), 2);
85  }
86 
87  Real p0()
88  {
89  return gas_property.pressure;
90  }
91 
92  Real rho() const
93  {
94  return gas_property.rho;
95  }
96 
100  void init();
101 
102  Real rho_u1() const
103  {
104  return gas_property.rho * velocity_magnitude() * flow_unit_vector(0);
105  }
106 
107  Real rho_u2() const
108  {
109  return gas_property.rho * velocity_magnitude() * flow_unit_vector(1);
110  }
111 
112  Real rho_u3() const
113  {
114  return gas_property.rho * velocity_magnitude() * flow_unit_vector(2);
115  }
116 
117  Real rho_e() const
118  {
119  return gas_property.rho * gas_property.cv * gas_property.T + q0();
120  }
121 
122  Real rho_sens_rho() const {
123 
124  return 1.;
125  }
126 
128 
129  return this->rho_u1() / this->rho();
130  }
131 
133 
134  return this->rho_u2() / this->rho();;
135  }
136 
138  {
139  return this->rho_e() / this->rho();;
140  }
141 
143 
144  return this->rho_u1()/mach;
145  }
146 
148 
149  return this->rho_u2()/mach;
150  }
151 
153  {
154  return 2.*q0()/mach;
155  }
156 
157  std::unique_ptr<MAST::FieldFunction<RealVectorX>> inf_sol;
158  };
159 
160 
161 
162  inline
163  void
165  {
166  gas_property.init();
168  }
169 
170 }
171 
172 #endif // __mast_fluid_condition_h__
173 
bool enable_shock_capturing
flag to turn on/off artificial dissipation for shock capturing terms in fluid flow analysis...
void init()
initializes the data
Definition: gas_property.h:90
Real mach
Flight Mach number.
Real rho_u2_sens_mach() const
Real rho_e_sens_rho() const
Real rho_sens_rho() const
libMesh::Real Real
RealVectorX flow_unit_vector
direction along which flow is defined
Real ref_chord
reference chord
Real rho_u2_sens_rho() const
void init()
initializes the data structures
Real velocity_magnitude() const
Velocity magnitude, whose direction is evaluated from the Euler angles.
Real q0() const
returns the flight dynamic pressure
Matrix< Real, Dynamic, 1 > RealVectorX
std::unique_ptr< MAST::FieldFunction< RealVectorX > > inf_sol
GasProperty gas_property
Ambient air properties.
Real rho_u1_sens_rho() const
Real rho
Property values for ideal gas.
Definition: gas_property.h:71
Real rho_u1_sens_mach() const
Real rho_e_sens_mach() const