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, const int step);
73
75 Array<OneD, NekDouble> &vFrameVels, const int step);
76
77 // gave access and set the displacement and angles between moving frame and
78 // stationary one
80 const Array<OneD, NekDouble> &vFrameDisp, const int step);
81
83 const Array<OneD, NekDouble> &vFramePivot);
84
86 Array<OneD, NekDouble> &vFrameDisp, const int step);
87
88 /// Set aerodynamic force and moment
90
91 /// Get aerodynamic force and moment
93
94protected:
96 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
97 Array<OneD, Array<OneD, NekDouble>> &velocity) = 0;
100 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
101 Array<OneD, NekDouble> &density) = 0;
103 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
106 [[maybe_unused]] const Array<OneD, NekDouble> &vFrameVels,
107 [[maybe_unused]] const int step)
108 {
109 }
111 [[maybe_unused]] Array<OneD, NekDouble> &vFrameVels,
112 [[maybe_unused]] const int step)
113 {
114 return false;
115 }
117 [[maybe_unused]] const Array<OneD, NekDouble> &vFrameDisp,
118 [[maybe_unused]] const int step)
119 {
120 }
122 [[maybe_unused]] const Array<OneD, NekDouble> &vFramePivot)
123 {
124 }
126 [[maybe_unused]] Array<OneD, NekDouble> &vFrameDisp,
127 [[maybe_unused]] const int step)
128 {
129 return false;
130 }
131
133 [[maybe_unused]] Array<OneD, NekDouble> forces)
134 {
135 }
136
138 [[maybe_unused]] Array<OneD, NekDouble> forces)
139 {
140 }
141};
142
143/**
144 *
145 */
147 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
149{
150 v_GetVelocity(physfield, velocity);
151}
152
153/**
154 *
155 */
157{
158 return v_HasConstantDensity();
159}
160
161/**
162 *
163 */
165 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
166 Array<OneD, NekDouble> &density)
167{
168 v_GetDensity(physfield, density);
169}
170
171/**
172 *
173 */
175 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
177{
178 v_GetPressure(physfield, pressure);
179}
180
181/**
182 *
183 */
185 const Array<OneD, NekDouble> &vFrameVels, const int step)
186{
187 v_SetMovingFrameVelocities(vFrameVels, step);
188}
189
190/**
191 *
192 */
194 Array<OneD, NekDouble> &vFrameVels, const int step)
195{
196 return v_GetMovingFrameVelocities(vFrameVels, step);
197}
198
199/**
200 *
201 */
203 const Array<OneD, NekDouble> &vFrameDisp, const int step)
204{
205 v_SetMovingFrameDisp(vFrameDisp, step);
206}
207
208/**
209 *
210 */
212 const Array<OneD, NekDouble> &vFramePivot)
213{
214 v_SetMovingFramePivot(vFramePivot);
215}
216
218 Array<OneD, NekDouble> &vFrameDisp, const int step)
219{
220 return v_GetMovingFrameDisp(vFrameDisp, step);
221}
222
224{
225 v_SetAeroForce(forces);
226}
227
229{
230 v_GetAeroForce(forces);
231}
232
233} // namespace Nektar::SolverUtils
234
235#endif
#define SOLVER_UTILS_EXPORT
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 SetMovingFrameDisp(const Array< OneD, NekDouble > &vFrameDisp, const int step)
virtual SOLVER_UTILS_EXPORT bool v_HasConstantDensity()=0
SOLVER_UTILS_EXPORT bool HasConstantDensity()
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameDisp(const Array< OneD, NekDouble > &vFrameDisp, const int step)
SOLVER_UTILS_EXPORT void GetDensity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)
Extract array with density from physfield.
SOLVER_UTILS_EXPORT bool GetMovingFrameDisp(Array< OneD, NekDouble > &vFrameDisp, const int step)
SOLVER_UTILS_EXPORT void SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels, const int step)
virtual SOLVER_UTILS_EXPORT void v_GetAeroForce(Array< OneD, NekDouble > forces)
virtual SOLVER_UTILS_EXPORT bool v_GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels, const int step)
SOLVER_UTILS_EXPORT void GetAeroForce(Array< OneD, NekDouble > forces)
Get aerodynamic force and moment.
SOLVER_UTILS_EXPORT bool GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels, const int step)
virtual SOLVER_UTILS_EXPORT void v_SetAeroForce(Array< OneD, NekDouble > forces)
virtual SOLVER_UTILS_EXPORT void v_SetMovingFramePivot(const Array< OneD, NekDouble > &vFramePivot)
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_SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels, const int step)
virtual SOLVER_UTILS_EXPORT bool v_GetMovingFrameDisp(Array< OneD, NekDouble > &vFrameDisp, const int step)
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 SetMovingFramePivot(const Array< OneD, NekDouble > &vFramePivot)
virtual SOLVER_UTILS_EXPORT void v_GetPressure(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)=0