Nektar++
FilterInterfaces.hpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: FilterInterfaces.hpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Interface class for solvers that support fluid physics
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SOLVERUTILS_FILTERS_FILTERINTERFACES_HPP
36#define NEKTAR_SOLVERUTILS_FILTERS_FILTERINTERFACES_HPP
37
38#include <boost/numeric/ublas/matrix.hpp>
39#include <boost/numeric/ublas/vector.hpp>
40
43
44namespace Nektar::SolverUtils
45{
46
48{
49public:
50 virtual ~FluidInterface() = default;
51
52 /// Extract array with velocity from physfield
54 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
56
58
59 /// Extract array with density from physfield
61 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
62 Array<OneD, NekDouble> &density);
63
64 /// Extract array with pressure from physfield
66 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
68
69 // gave access and set to the moving frame velocity
70 // for Moving reference frame formulation
72 const Array<OneD, NekDouble> &vFrameVels);
73
75 Array<OneD, NekDouble> &vFrameVels);
76
77 // gave access and set to the projection matrix that transfers
78 // between stationary inertial frame and moving reference frame
80 const boost::numeric::ublas::matrix<NekDouble> &vProjMat);
81
83 boost::numeric::ublas::matrix<NekDouble> &vProjMat);
84
85 // gave access and set the displacement and angles between moving frame and
86 // stationary one
88 const Array<OneD, NekDouble> &vFrameDisp);
89
91 Array<OneD, NekDouble> &vFrameDisp);
92
93 /// Set aerodynamic force and moment
95
96 /// Get aerodynamic force and moment
98
99protected:
101 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
105 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
106 Array<OneD, NekDouble> &density) = 0;
108 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
111 [[maybe_unused]] const Array<OneD, NekDouble> &vFrameVels)
112 {
113 }
115 [[maybe_unused]] Array<OneD, NekDouble> &vFrameVels)
116 {
117 }
119 [[maybe_unused]] const boost::numeric::ublas::matrix<NekDouble>
120 &vProjMat)
121 {
122 }
124 [[maybe_unused]] boost::numeric::ublas::matrix<NekDouble> &vProjMat)
125 {
126 }
128 [[maybe_unused]] const Array<OneD, NekDouble> &vFrameDisp)
129 {
130 }
132 [[maybe_unused]] Array<OneD, NekDouble> &vFrameDisp)
133 {
134 }
135
137 [[maybe_unused]] Array<OneD, NekDouble> forces)
138 {
139 }
140
142 [[maybe_unused]] Array<OneD, NekDouble> forces)
143 {
144 }
145};
146
147/**
148 *
149 */
151 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
153{
154 v_GetVelocity(physfield, velocity);
155}
156
157/**
158 *
159 */
161{
162 return v_HasConstantDensity();
163}
164
165/**
166 *
167 */
169 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
170 Array<OneD, NekDouble> &density)
171{
172 v_GetDensity(physfield, density);
173}
174
175/**
176 *
177 */
179 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
181{
182 v_GetPressure(physfield, pressure);
183}
184
185/**
186 *
187 */
189 const Array<OneD, NekDouble> &vFrameVels)
190{
191 v_SetMovingFrameVelocities(vFrameVels);
192}
193
194/**
195 *
196 */
198 Array<OneD, NekDouble> &vFrameVels)
199{
200 v_GetMovingFrameVelocities(vFrameVels);
201}
202
203/**
204 *
205 */
207 const boost::numeric::ublas::matrix<NekDouble> &vProjMat)
208{
210}
211
212/**
213 *
214 */
216 boost::numeric::ublas::matrix<NekDouble> &vProjMat)
217{
219}
220
221/**
222 *
223 */
225 const Array<OneD, NekDouble> &vFrameDisp)
226{
227 v_SetMovingFrameDisp(vFrameDisp);
228}
229
231 Array<OneD, NekDouble> &vFrameDisp)
232{
233 v_GetMovingFrameDisp(vFrameDisp);
234}
235
237{
238 v_SetAeroForce(forces);
239}
240
242{
243 v_GetAeroForce(forces);
244}
245
246} // namespace Nektar::SolverUtils
247
248#endif
#define SOLVER_UTILS_EXPORT
virtual SOLVER_UTILS_EXPORT void v_GetMovingFrameDisp(Array< OneD, NekDouble > &vFrameDisp)
virtual SOLVER_UTILS_EXPORT void v_GetDensity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)=0
SOLVER_UTILS_EXPORT void SetAeroForce(Array< OneD, NekDouble > forces)
Set aerodynamic force and moment.
SOLVER_UTILS_EXPORT void SetMovingFrameProjectionMat(const boost::numeric::ublas::matrix< NekDouble > &vProjMat)
SOLVER_UTILS_EXPORT void GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels)
SOLVER_UTILS_EXPORT void SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels)
virtual SOLVER_UTILS_EXPORT bool v_HasConstantDensity()=0
virtual SOLVER_UTILS_EXPORT void v_GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels)
SOLVER_UTILS_EXPORT bool HasConstantDensity()
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels)
SOLVER_UTILS_EXPORT void SetMovingFrameDisp(const Array< OneD, NekDouble > &vFrameDisp)
SOLVER_UTILS_EXPORT void GetDensity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)
Extract array with density from physfield.
virtual SOLVER_UTILS_EXPORT void v_GetAeroForce(Array< OneD, NekDouble > forces)
SOLVER_UTILS_EXPORT void GetAeroForce(Array< OneD, NekDouble > forces)
Get aerodynamic force and moment.
SOLVER_UTILS_EXPORT void GetMovingFrameDisp(Array< OneD, NekDouble > &vFrameDisp)
virtual SOLVER_UTILS_EXPORT void v_SetAeroForce(Array< OneD, NekDouble > forces)
SOLVER_UTILS_EXPORT void GetPressure(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)
Extract array with pressure from physfield.
virtual SOLVER_UTILS_EXPORT void v_GetVelocity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)=0
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameProjectionMat(const boost::numeric::ublas::matrix< NekDouble > &vProjMat)
SOLVER_UTILS_EXPORT void GetVelocity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
Extract array with velocity from physfield.
SOLVER_UTILS_EXPORT void GetMovingFrameProjectionMat(boost::numeric::ublas::matrix< NekDouble > &vProjMat)
virtual SOLVER_UTILS_EXPORT void v_GetPressure(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)=0
virtual SOLVER_UTILS_EXPORT void v_GetMovingFrameProjectionMat(boost::numeric::ublas::matrix< NekDouble > &vProjMat)
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameDisp(const Array< OneD, NekDouble > &vFrameDisp)
const std::vector< NekDouble > velocity