OpenLB 1.7
Loading...
Searching...
No Matches
superPlaneIntegralFluxMass3D.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_MASS_3D_HH
25#define SUPER_PLANE_INTEGRAL_FLUX_MASS_3D_HH
26
28
29#include "io/ostreamManager.h"
33
36
37namespace olb {
38
39
40template<typename T>
42 FunctorPtr<SuperF3D<T>>&& velocityF,
43 FunctorPtr<SuperF3D<T>>&& densityF,
44 SuperGeometry<T,3>& geometry,
45 T conversationFactorMass,
46 T conversationFactorTime,
47 const HyperplaneLattice3D<T>& hyperplaneLattice,
48 FunctorPtr<SuperIndicatorF3D<T>>&& integrationIndicator,
49 FunctorPtr<IndicatorF2D<T>>&& subplaneIndicator,
52 (*densityF) * (*velocityF),
53 geometry,
54 hyperplaneLattice,
55 std::forward<decltype(integrationIndicator)>(integrationIndicator),
56 std::forward<decltype(subplaneIndicator)>(subplaneIndicator),
57 mode),
58 _velocityF(std::move(velocityF)),
59 _densityF(std::move(densityF)),
60 _conversationFactorMass(conversationFactorMass),
61 _conversationFactorTime(conversationFactorTime)
62{
63 this->getName() = "SuperPlaneIntegralFluxMass3D";
64}
65
66template<typename T>
68 FunctorPtr<SuperF3D<T>>&& velocityF,
69 FunctorPtr<SuperF3D<T>>&& densityF,
70 SuperGeometry<T,3>& geometry,
71 T conversationFactorMass,
72 T conversationFactorTime,
73 const Hyperplane3D<T>& hyperplane,
74 FunctorPtr<SuperIndicatorF3D<T>>&& integrationIndicator,
75 FunctorPtr<IndicatorF2D<T>>&& subplaneIndicator,
78 (*densityF) * (*velocityF),
79 geometry,
80 hyperplane,
81 std::forward<decltype(integrationIndicator)>(integrationIndicator),
82 std::forward<decltype(subplaneIndicator)>(subplaneIndicator),
83 mode),
84 _velocityF(std::move(velocityF)),
85 _densityF(std::move(densityF)),
86 _conversationFactorMass(conversationFactorMass),
87 _conversationFactorTime(conversationFactorTime)
88{
89 this->getName() = "SuperPlaneIntegralFluxMass3D";
90}
91
92template<typename T>
94 FunctorPtr<SuperF3D<T>>&& velocityF,
95 FunctorPtr<SuperF3D<T>>&& densityF,
96 SuperGeometry<T,3>& geometry,
97 T conversationFactorMass,
98 T conversationFactorTime,
99 const Hyperplane3D<T>& hyperplane,
100 FunctorPtr<SuperIndicatorF3D<T>>&& integrationIndicator,
103 (*densityF) * (*velocityF),
104 geometry,
105 hyperplane,
106 std::forward<decltype(integrationIndicator)>(integrationIndicator),
107 mode),
108 _velocityF(std::move(velocityF)),
109 _densityF(std::move(densityF)),
110 _conversationFactorMass(conversationFactorMass),
111 _conversationFactorTime(conversationFactorTime)
112{
113 this->getName() = "SuperPlaneIntegralFluxMass3D";
114}
115
116template<typename T>
118 FunctorPtr<SuperF3D<T>>&& velocityF,
119 FunctorPtr<SuperF3D<T>>&& densityF,
120 SuperGeometry<T,3>& geometry,
121 T conversationFactorMass,
122 T conversationFactorTime,
123 const Vector<T,3>& origin, const Vector<T,3>& u, const Vector<T,3>& v,
124 std::vector<int> materials,
127 (*densityF) * (*velocityF),
128 geometry,
129 origin, u, v,
130 std::move(materials),
131 mode),
132 _velocityF(std::move(velocityF)),
133 _densityF(std::move(densityF)),
134 _conversationFactorMass(conversationFactorMass),
135 _conversationFactorTime(conversationFactorTime)
136{
137 this->getName() = "SuperPlaneIntegralFluxMass3D";
138}
139
140template<typename T>
142 FunctorPtr<SuperF3D<T>>&& velocityF,
143 FunctorPtr<SuperF3D<T>>&& densityF,
144 SuperGeometry<T,3>& geometry,
145 T conversationFactorMass,
146 T conversationFactorTime,
147 const Vector<T,3>& origin, const Vector<T,3>& u, const Vector<T,3>& v,
150 (*densityF) * (*velocityF),
151 geometry,
152 origin, u, v,
153 mode),
154 _velocityF(std::move(velocityF)),
155 _densityF(std::move(densityF)),
156 _conversationFactorMass(conversationFactorMass),
157 _conversationFactorTime(conversationFactorTime)
158{
159 this->getName() = "SuperPlaneIntegralFluxMass3D";
160}
161
162template<typename T>
164 FunctorPtr<SuperF3D<T>>&& velocityF,
165 FunctorPtr<SuperF3D<T>>&& densityF,
166 SuperGeometry<T,3>& geometry,
167 T conversationFactorMass,
168 T conversationFactorTime,
169 IndicatorCircle3D<T>& circle,
170 std::vector<int> materials,
173 (*densityF) * (*velocityF),
174 geometry,
175 circle,
176 std::move(materials),
177 mode),
178 _velocityF(std::move(velocityF)),
179 _densityF(std::move(densityF)),
180 _conversationFactorMass(conversationFactorMass),
181 _conversationFactorTime(conversationFactorTime)
182{
183 this->getName() = "SuperPlaneIntegralFluxMass3D";
184}
185
186template<typename T>
188 FunctorPtr<SuperF3D<T>>&& velocityF,
189 FunctorPtr<SuperF3D<T>>&& densityF,
190 SuperGeometry<T,3>& geometry,
191 T conversationFactorMass,
192 T conversationFactorTime,
193 IndicatorCircle3D<T>& circle,
196 (*densityF) * (*velocityF),
197 geometry,
198 circle,
199 mode),
200 _velocityF(std::move(velocityF)),
201 _densityF(std::move(densityF)),
202 _conversationFactorMass(conversationFactorMass),
203 _conversationFactorTime(conversationFactorTime)
204{
205 this->getName() = "SuperPlaneIntegralFluxMass3D";
206}
207
208template<typename T>
209bool SuperPlaneIntegralFluxMass3D<T>::operator()(T output[], const int input[])
210{
211 const bool result = SuperPlaneIntegralF3D<T>::operator()(output, input);
212
213 output[0] = output[0] * _conversationFactorMass / _conversationFactorTime;
214
215 return result;
216}
217
218template<typename T>
220 std::string regionName, std::string massFluxSiScaleName)
221{
222 OstreamManager clout("SuperPlaneIntegralFluxMass3D");
223 int input[1] = { };
224 T output[this->getTargetDim()]; // = 5
225 operator()(output, input);
226 if (regionName != "") {
227 clout << "regionName=" << regionName << "; regionSize[m^2]=" << output[1]
228 << std::flush;
229 }
230 else {
231 clout << "regionSize[m^2]=" << output[1] << std::flush;
232 }
233 if (singleton::mpi().isMainProcessor()) {
234 if (massFluxSiScaleName == "mcg/s") { // milli gramm
235 std::cout << "; massFlowRate[mcg/s]=" << output[0] * T(1.e6)
236 << std::endl;
237 }
238 else if (massFluxSiScaleName == "mg/s") { // micro gramm
239 std::cout << "; massFlowRate[mg/s]=" << output[0] * T(1.e3)
240 << std::endl;
241 }
242 else {
243 std::cout << "; massFlowRate[kg/s]=" << output[0] << std::endl;
244 }
245 }
246}
247
248
249}
250
251#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)
Surface integral of a subset of a interpolated hyperplane.
bool operator()(T output[], const int input[]) override
Returns the plane integral in the following structure:
bool operator()(T output[], const int input[]) override
SuperPlaneIntegralFluxMass3D(FunctorPtr< SuperF3D< T > > &&velocityF, FunctorPtr< SuperF3D< T > > &&densityF, SuperGeometry< T, 3 > &geometry, T conversationFactorMass, T conversationFactorTime, const HyperplaneLattice3D< T > &hyperplaneLattice, FunctorPtr< SuperIndicatorF3D< T > > &&integrationIndicator, FunctorPtr< IndicatorF2D< T > > &&subplaneIndicator, BlockDataReductionMode mode=BlockDataReductionMode::Analytical)
Primary constructor.
void print(std::string regionName, std::string massFluxSiScaleName)
Plain old scalar vector.
Definition vector.h:47
Groups all include files for the directory genericFunctions.
MpiManager & mpi()
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.