OpenLB 1.7
Loading...
Searching...
No Matches
superPlaneIntegralFluxF3D.hh
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2017 Adrian Kummerlaender
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program 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
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef SUPER_PLANE_INTEGRAL_FLUX_F_3D_HH
25#define SUPER_PLANE_INTEGRAL_FLUX_F_3D_HH
26
28
29#include "io/ostreamManager.h"
33
34namespace olb {
35
36
37template<typename T, template<typename, typename> class F>
38template<typename DESCRIPTOR>
41 const UnitConverter<T,DESCRIPTOR>& converter,
42 SuperGeometry<T,3>& geometry,
43 const HyperplaneLattice3D<T>& hyperplaneLattice,
44 FunctorPtr<SuperIndicatorF3D<T>>&& integrationIndicator,
45 FunctorPtr<IndicatorF2D<T>>&& subplaneIndicator,
48 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
49 geometry,
50 hyperplaneLattice,
51 std::forward<decltype(integrationIndicator)>(integrationIndicator),
52 std::forward<decltype(subplaneIndicator)>(subplaneIndicator),
53 mode)
54{
55 this->getName() = "SuperPlaneIntegralFluxF3D";
56}
57
58template<typename T, template<typename, typename> class F>
59template<typename DESCRIPTOR>
62 const UnitConverter<T,DESCRIPTOR>& converter,
63 SuperGeometry<T,3>& geometry,
64 const Hyperplane3D<T>& hyperplane,
65 FunctorPtr<SuperIndicatorF3D<T>>&& integrationIndicator,
66 FunctorPtr<IndicatorF2D<T>>&& subplaneIndicator,
69 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
70 geometry,
71 hyperplane,
72 std::forward<decltype(integrationIndicator)>(integrationIndicator),
73 std::forward<decltype(subplaneIndicator)>(subplaneIndicator),
74 mode)
75{
76 this->getName() = "SuperPlaneIntegralFluxF3D";
77}
78
79template<typename T, template<typename, typename> class F>
80template<typename DESCRIPTOR>
83 const UnitConverter<T,DESCRIPTOR>& converter,
85 const Hyperplane3D<T>& hyperplane,
86 FunctorPtr<SuperIndicatorF3D<T>>&& integrationIndicator,
89 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
90 geometry,
91 hyperplane,
92 std::forward<decltype(integrationIndicator)>(integrationIndicator),
93 mode)
94{
95 this->getName() = "SuperPlaneIntegralFluxF3D";
96}
97
98template<typename T, template<typename, typename> class F>
99template<typename DESCRIPTOR>
102 const UnitConverter<T,DESCRIPTOR>& converter,
103 SuperGeometry<T,3>& geometry,
104 const Vector<T,3>& origin, const Vector<T,3>& u, const Vector<T,3>& v,
105 std::vector<int> materials,
108 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
109 geometry,
110 origin, u, v,
111 std::move(materials),
112 mode)
113{
114 this->getName() = "SuperPlaneIntegralFluxF3D";
116
117template<typename T, template<typename, typename> class F>
118template<typename DESCRIPTOR>
121 const UnitConverter<T,DESCRIPTOR>& converter,
123 const Vector<T,3>& origin, const Vector<T,3>& u, const Vector<T,3>& v,
126 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
127 geometry,
128 origin, u, v,
129 mode)
130{
131 this->getName() = "SuperPlaneIntegralFluxF3D";
132}
133
134template<typename T, template<typename, typename> class F>
135template<typename DESCRIPTOR>
138 const UnitConverter<T,DESCRIPTOR>& converter,
139 SuperGeometry<T,3>& geometry,
140 const Vector<T,3>& origin, const Vector<T,3>& normal,
141 std::vector<int> materials,
144 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
145 geometry,
146 origin, normal,
147 std::move(materials),
148 mode)
149{
150 this->getName() = "SuperPlaneIntegralFluxF3D";
151}
152
153template<typename T, template<typename, typename> class F>
154template<typename DESCRIPTOR>
157 const UnitConverter<T,DESCRIPTOR>& converter,
158 SuperGeometry<T,3>& geometry,
159 const Vector<T,3>& origin, const Vector<T,3>& normal,
162 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
163 geometry,
164 origin, normal,
165 mode)
166{
167 this->getName() = "SuperPlaneIntegralFluxF3D";
168}
169
170template<typename T, template<typename, typename> class F>
171template<typename DESCRIPTOR>
174 const UnitConverter<T,DESCRIPTOR>& converter,
175 SuperGeometry<T,3>& geometry,
176 const Vector<T,3>& normal,
177 std::vector<int> materials,
180 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
181 geometry,
182 normal,
183 std::move(materials),
184 mode)
185{
186 this->getName() = "SuperPlaneIntegralFluxF3D";
187}
188
189template<typename T, template<typename, typename> class F>
190template<typename DESCRIPTOR>
193 const UnitConverter<T,DESCRIPTOR>& converter,
194 SuperGeometry<T,3>& geometry,
195 const Vector<T,3>& normal,
198 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
199 geometry,
200 normal,
201 mode)
202{
203 this->getName() = "SuperPlaneIntegralFluxF3D";
204}
205
206template<typename T, template<typename, typename> class F>
207template<typename DESCRIPTOR>
210 const UnitConverter<T,DESCRIPTOR>& converter,
211 SuperGeometry<T,3>& geometry,
212 IndicatorCircle3D<T>& circle,
213 std::vector<int> materials,
216 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
217 geometry,
218 circle,
219 std::move(materials),
220 mode)
221{
222 this->getName() = "SuperPlaneIntegralFluxF3D";
223}
224
225template<typename T, template<typename, typename> class F>
226template<typename DESCRIPTOR>
229 const UnitConverter<T,DESCRIPTOR>& converter,
230 SuperGeometry<T,3>& geometry,
231 IndicatorCircle3D<T>& circle,
234 std::unique_ptr<SuperF3D<T>>(new F<T, DESCRIPTOR>(sLattice, converter)),
235 geometry,
236 circle,
237 mode)
238{
239 this->getName() = "SuperPlaneIntegralFluxF3D";
240}
241
242template<typename T>
244 std::string regionName, std::string fluxSiScaleName, std::string meanSiScaleName)
245{
246 OstreamManager clout("SuperPlaneIntegralFluxPressure3D");
247 int input[1] = { };
248 T output[this->getTargetDim()];
249 this->operator()(output, input);
250 if ( regionName != "" ) {
251 clout << "regionName=" << regionName << "; regionSize[m^2]=" << output[1]
252 << std::flush;
253 }
254 else {
255 clout << "regionSize[m^2]=" << output[1] << std::flush;
256 }
257 if ( singleton::mpi().isMainProcessor() ) {
258 if ( fluxSiScaleName == "MN" ) {
259 std::cout << "; force[MN]=" << output[0] / T(1.e6) << std::flush;
260 }
261 else if ( fluxSiScaleName == "kN" ) {
262 std::cout << "; force[kN]=" << output[0] / T(1.e3) << std::flush;
263 }
264 else {
265 std::cout << "; force[N]=" << output[0] << std::flush;
266 }
267 if ( meanSiScaleName == "mmHg" ) {
268 std::cout << "; meanPressure[mmHg]=" << util::abs(output[0])/output[1]/T(133.322) << std::endl;
269 }
270 else {
271 std::cout << "; meanPressure[Pa]=" << util::abs(output[0])/output[1] << std::endl;
272 }
273 }
274}
275
276
277template<typename T>
279 std::string regionName, std::string fluxSiScaleName, std::string meanSiScaleName)
280{
281 OstreamManager clout("SuperPlaneIntegralFluxVelocity3D");
282 int input[1] = { };
283 T output[this->getTargetDim()];
284 this->operator()(output, input);
285 if ( regionName != "" ) {
286 clout << "regionName=" << regionName << "; regionSize[m^2]=" << output[1]
287 << std::flush;
288 }
289 else {
290 clout << "regionSize[m^2]=" << output[1] << std::flush;
291 }
292 if ( singleton::mpi().isMainProcessor() ) {
293 if ( fluxSiScaleName == "ml/s" ) {
294 std::cout << "; volumetricFlowRate[ml/s]=" << output[0] * T(1.e6)
295 << std::flush;
296 }
297 else if ( fluxSiScaleName == "l/s" ) {
298 std::cout << "; volumetricFlowRate[l/s]=" << output[0] * T(1.e3)
299 << std::flush;
300 }
301 else {
302 std::cout << "; volumetricFlowRate[m^3/s]=" << output[0] << std::flush;
303 }
304 if ( meanSiScaleName == "mm/s" ) {
305 std::cout << "; meanVelocity[mm/s]=" << output[0] / output[1] * T(1.e3)
306 << std::endl;
307 }
308 else {
309 std::cout << "; meanVelocity[m/s]=" << output[0] / output[1] << std::endl;
310 }
311 }
312}
313
314
315}
316
317#endif
Smart pointer for managing the various ways of passing functors around.
Definition functorPtr.h:60
std::string & getName()
read and write access to name
Definition genericF.hh:51
Parametrization of a hyperplane lattice.
indicator function for a 3D circle
IndicatorF2D is an application from .
class for marking output with some text
represents all functors that operate on a SuperStructure<T,3> in general
Representation of a statistic for a parallel 2D geometry.
Base indicator functor (discrete)
Super class maintaining block lattices for a cuboid decomposition.
Surface integral of a subset of a interpolated hyperplane.
Template class for building flux integrals based on SuperLatticePhysF3D functors.
SuperPlaneIntegralFluxF3D(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter, SuperGeometry< T, 3 > &geometry, const HyperplaneLattice3D< T > &hyperplaneLattice, FunctorPtr< SuperIndicatorF3D< T > > &&integrationIndicator, FunctorPtr< IndicatorF2D< T > > &&subplaneIndicator, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
void print(std::string regionName="", std::string fluxSiScaleName="N", std::string meanSiScaleName="Pa")
void print(std::string regionName="", std::string fluxSiScaleName="m^3/s", std::string meanSiScaleName="m/s")
Conversion between physical and lattice units, as well as discretization.
Plain old scalar vector.
Definition vector.h:47
Groups all include files for the directory genericFunctions.
MpiManager & mpi()
ADf< T, DIM > abs(const ADf< T, DIM > &a)
Definition aDiff.h:1019
Top level namespace for all of OpenLB.
BlockDataReductionMode
Mode of reducing block data from given, possibly higher dimensional data.
Definition of a analytical 2D plane embedded in 3D space.