MAST
piston_theory_boundary_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__piston_theory_boundary_condition__
21 #define __mast__piston_theory_boundary_condition__
22 
23 // MAST includes
26 
27 
28 namespace MAST {
29 
30  // Forward declerations
31  class Parameter;
32 
33  // defines the function class the evaluates the pressure for calculation
34  // of surface loads. The deflection and velocity data is provided
35  // for calculation
37  public MAST::FieldFunction<Real> {
38 
39  public:
40 
41  PistonTheoryPressure(unsigned int order,
44  const MAST::FieldFunction<Real>& rho,
45  const MAST::FieldFunction<Real>& gamma,
46  const MAST::FieldFunction<Real>& dwdx,
47  const MAST::FieldFunction<Real>& dwdt);
48 
49  virtual ~PistonTheoryPressure();
50 
51 
52  virtual void operator() (const libMesh::Point& p,
53  const Real t,
54  Real& m) const;
55 
56  virtual void derivative (const MAST::FunctionBase& f,
57  const libMesh::Point& p,
58  const Real t,
59  Real& m) const;
60 
61  protected:
62 
63  const unsigned int _order;
64 
67  &_M_inf,
68  &_rho_inf,
69  &_gamma,
70  &_dwdx,
71  &_dwdt;
72  };
73 
74 
75 
76 
77 
78  // defines the function class the evaluates the pressure for calculation
79  // of surface loads. The deflection and velocity data is provided
80  // for calculation
82  public MAST::FieldFunction<Real> {
83 
84  public:
85 
86  PistonTheoryPressureXDerivative(unsigned int order,
89  const MAST::FieldFunction<Real>& rho,
90  const MAST::FieldFunction<Real>& gamma,
91  const MAST::FieldFunction<Real>& dwdx,
92  const MAST::FieldFunction<Real>& dwdt);
93 
94 
96 
97 
98  virtual void operator() (const libMesh::Point& p,
99  const Real t,
100  Real& m) const;
101 
102  virtual void derivative (const MAST::FunctionBase& f,
103  const libMesh::Point& p,
104  const Real t,
105  Real& m) const;
106 
107  protected:
108 
109  const unsigned int _order;
110 
113  &_M_inf,
114  &_rho_inf,
115  &_gamma,
116  &_dwdx,
117  &_dwdt;
118  };
119 
120 
121 
122 
123  // defines the function class the evaluates the pressure for calculation
124  // of surface loads. The deflection and velocity data is provided
125  // for calculation
127  public MAST::FieldFunction<Real> {
128 
129  public:
130 
131  PistonTheoryPressureXdotDerivative(unsigned int order,
132  const MAST::FieldFunction<Real>& V,
133  const MAST::FieldFunction<Real>& M,
134  const MAST::FieldFunction<Real>& rho,
135  const MAST::FieldFunction<Real>& gamma,
136  const MAST::FieldFunction<Real>& dwdx,
137  const MAST::FieldFunction<Real>& dwdt);
138 
139 
141 
142 
143  virtual void operator() (const libMesh::Point& p,
144  const Real t,
145  Real& m) const;
146 
147  virtual void derivative (const MAST::FunctionBase& f,
148  const libMesh::Point& p,
149  const Real t,
150  Real& m) const;
151 
152  protected:
153 
154  const unsigned int _order;
155 
158  &_M_inf,
159  &_rho_inf,
160  &_gamma,
161  &_dwdx,
162  &_dwdt;
163  };
164 
165 
166 
169 
170  public:
171 
181  PistonTheoryBoundaryCondition(unsigned int order,
182  const RealVectorX& vel_vec);
183 
184 
186 
187 
191  unsigned int order() const;
192 
196  const RealVectorX& vel_vec() const;
197 
198 
202  std::unique_ptr<MAST::FieldFunction<Real> >
203  get_pressure_function(const MAST::FieldFunction<Real>& dwdx,
204  const MAST::FieldFunction<Real>& dwdt) const;
205 
206 
207 
211  std::unique_ptr<MAST::FieldFunction<Real> >
212  get_dpdx_function(const MAST::FieldFunction<Real>& dwdx,
213  const MAST::FieldFunction<Real>& dwdt) const;
214 
215 
216 
220  std::unique_ptr<MAST::FieldFunction<Real> >
221  get_dpdxdot_function(const MAST::FieldFunction<Real>& dwdx,
222  const MAST::FieldFunction<Real>& dwdt) const;
223 
224 
225  protected:
226 
227 
231  unsigned int _order;
232 
233 
238 
239  };
240 }
241 
242 
243 #endif /* __mast__piston_theory_boundary_condition__ */
244 
const MAST::FieldFunction< Real > & _gamma
virtual void operator()(const libMesh::Point &p, const Real t, Real &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
const MAST::FieldFunction< Real > & _dwdt
const MAST::FieldFunction< Real > & _M_inf
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, Real &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...
libMesh::Real Real
const MAST::FieldFunction< Real > & _V_inf
const MAST::FieldFunction< Real > & _dwdx
This creates the base class for functions that have a saptial and temporal dependence, and provide sensitivity operations with respect to the functions and parameters.
Matrix< Real, Dynamic, 1 > RealVectorX
RealVectorX _vel_vec
Ambient flow velocity vector.
const MAST::FieldFunction< Real > & _rho_inf
PistonTheoryPressure(unsigned int order, const MAST::FieldFunction< Real > &V, const MAST::FieldFunction< Real > &M, const MAST::FieldFunction< Real > &rho, const MAST::FieldFunction< Real > &gamma, const MAST::FieldFunction< Real > &dwdx, const MAST::FieldFunction< Real > &dwdt)
unsigned int _order
Order of the boundary condition.