OpenLB 1.7
Loading...
Searching...
No Matches
frameChangeF2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2014-2015 Mathias J. Krause, Marie-Luise Maier
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 ANALYTICAL_FRAME_CHANGE_F_2D_H
25#define ANALYTICAL_FRAME_CHANGE_F_2D_H
26
27#include<vector>
28#include<cmath>
29#include<string>
30#include"math.h"
31
32#include "functors/genericF.h"
33#include "analyticalF.h"
34#include "core/superLattice2D.h"
35
50/* To enable simulations in a rotating frame, the axis is set in the
51 * constructor with axisPoint and axisDirection. The axisPoint can be the
52 * coordinate of any point on the axis. The axisDirection has to be a normed to
53 * 1. The pulse w is in rad/s. It determines the pulse speed by its norm while
54 * the trigonometric or clockwise direction is determined by its sign: When the
55 * axisDirection is pointing "towards you", a positive pulse makes it turn in
56 * the trigonometric way. It has to be noticed that putting both axisDirection
57 * into -axisDirection and w into -w yields an exactly identical situation.
58 */
59
60
61namespace olb {
62
63template <typename T>
64class PowerLaw2D : public AnalyticalF2D<T,T> {
65protected:
66 std::vector<T> _axisPoint;
67 std::vector<T> _axisDirection;
71
72public:
73 PowerLaw2D(std::vector<T> axisPoint, std::vector<T> axisDirection, T maxVelocity, T radius, T exponent);
75 PowerLaw2D(SuperGeometry<T,2>& superGeometry, int material, T maxVelocity, T distance2Wall, T exponent);
76 bool operator()(T output[], const T input[]) override;
77};
78
79template <typename T>
80class Poiseuille2D : public PowerLaw2D<T> {
81
82public:
83 Poiseuille2D(std::vector<T> axisPoint, std::vector<T> axisDirection, T maxVelocity, T radius);
85 Poiseuille2D(SuperGeometry<T,2>& superGeometry, int material, T maxVelocity, T distance2Wall);
86 //bool operator()(T output[], const T x[]);
87};
88
89
90template <typename T, typename S, typename DESCRIPTOR>
92protected:
95
96public:
98 bool operator()(T output[], const S input[]) override;
99};
100
103template <typename T>
105protected:
106 std::vector<T> axisDirection;
109public:
110 AnalyticalPorousVelocity2D(std::vector<T> axisDirection_, T K_, T mu_, T gradP_, T radius_, T eps_=T(1));
111 T getPeakVelocity();
112 bool operator()(T output[], const T input[]) override;
113};
114
115
117
118
123template <typename T, typename S>
125protected:
128 // std::vector<T> _normalToPlane;
129public:
134 bool operator()(T output[], const S x[]) override;
135};
136
137
145template <typename T, typename S>
147protected:
155public:
157 olb::Vector<T, 3> axisDirection,
158 olb::Vector<T, 3> orientation = {T(1),T(),T()});
159 CartesianToPolar2D(T cartesianOriginX, T cartesianOriginY,
160 T cartesianOriginZ,
161 T axisDirectionX, T axisDirectionY, T axisDirectionZ,
162 T orientationX = T(1), T orientationY = T(),
163 T orientationZ = T());
167 bool operator()(T output[], const S x[]) override;
168};
169
170} // end namespace olb
171#endif
AnalyticalF are applications from DD to XD, where X is set by the constructor.
Analytical solution of porous media channel flow with low Reynolds number See Spaid and Phelan (doi:1...
bool operator()(T output[], const T input[]) override
AnalyticalPorousVelocity2D(std::vector< T > axisDirection_, T K_, T mu_, T gradP_, T radius_, T eps_=T(1))
This class converts Cartesian coordinates of point x to polar coordinates wrote into output field (ou...
CartesianToPolar2D(olb::Vector< T, 3 > cartesianOrigin, olb::Vector< T, 3 > axisDirection, olb::Vector< T, 3 > orientation={T(1), T(), T()})
olb::Vector< T, 3 > _cartesianOrigin
origin of the Cartesian coordinate system
bool operator()(T output[], const S x[]) override
operator writes polar coordinates of Cartesian point x into output field, returns output[0] = radius ...
olb::Vector< T, 3 > _orientation
direction to know orientation for math positive to obtain angle phi of Cartesian point x
olb::Vector< T, 3 > _axisDirection
direction of the axis along which the polar coordinates are calculated
Poiseuille2D(std::vector< T > axisPoint, std::vector< T > axisDirection, T maxVelocity, T radius)
bool operator()(T output[], const S input[]) override
has to be implemented for 'every' derived class
PoiseuilleStrainRate2D(UnitConverter< T, DESCRIPTOR > const &converter, T ly)
This class converts polar coordinates of point x (x[0] = radius, x[1] = phi) to Cartesian coordinates...
bool operator()(T output[], const S x[]) override
operator writes Cartesian coordinates of polar coordinates x[0] = radius >= 0, x[1] = phi in [0,...
PolarToCartesian2D(olb::Vector< T, 3 > polarOrigin)
constructor to obtain Cartesian coordinates of polar coordinates
olb::Vector< T, 3 > _polarOrigin
origin of the polar coordinate system to which point x is related
PowerLaw2D(std::vector< T > axisPoint, std::vector< T > axisDirection, T maxVelocity, T radius, T exponent)
std::vector< T > _axisDirection
std::vector< T > _axisPoint
bool operator()(T output[], const T input[]) override
Representation of a statistic for a parallel 2D geometry.
Conversion between physical and lattice units, as well as discretization.
Plain old scalar vector.
Definition vector.h:47
The description of a generic interface for all functor classes – header file.
Top level namespace for all of OpenLB.
The description of a 2D super lattice – header file.