24#ifndef ANALYTICAL_FRAME_CHANGE_F_2D_HH
25#define ANALYTICAL_FRAME_CHANGE_F_2D_HH
51 for (
int i = 0; i < 2; ++i) {
67 std::vector<int> discreteNormal = superGeometry.
getStatistics().computeDiscreteNormal(material);
68 for (
int i = 0; i < 2; ++i) {
73 for (
int iD = 0; iD < 2; iD++) {
84 T d =
util::fabs(_axisDirection[1]*(x[0] - _axisPoint[0]) - _axisDirection[0]*(x[1] - _axisPoint[1]));
85 output[0] = _maxVelocity*_axisDirection[0]*(1. -
util::pow(d/_radius,_exponent));
86 output[1] = _maxVelocity*_axisDirection[1]*(1. -
util::pow(d/_radius,_exponent));
87 if ( 1. -
util::pow(d/_radius,_exponent) < 0.) {
98 this->
getName() =
"Poiseuille2D";
105 this->
getName() =
"Poiseuille2D";
109template <
typename T,
typename S,
typename DESCRIPTOR>
111 :
AnalyticalF2D<T,S>(4), _lengthY(ly), _maxVelocity(converter.getCharPhysVelocity())
113 this->
getName() =
"PoiseuilleStrainRate2D";
117template <
typename T,
typename S,
typename DESCRIPTOR>
123 T DuDy = (T) _maxVelocity*(-2.*(y-(_lengthY/2.))/((_lengthY/2.)*(_lengthY/2.)));
127 output[0] = (DuDx + DuDx)/2.;
128 output[1] = (DuDy + DvDx)/2.;
129 output[2] = (DvDx + DuDy)/2.;
130 output[3] = (DvDy + DvDy)/2.;
137 :
AnalyticalF2D<T,T>(2), axisDirection(axisDirection_), K(K_), mu(mu_), gradP(gradP_),radius(radius_), eps(eps_)
139 this->
getName() =
"AnalyticalPorousVelocity2D";
158 output[0] *= axisDirection[0]/eps;
159 output[1] *= axisDirection[1]/eps;
170template<
typename T,
typename S>
173 _polarOrigin(polarOrigin)
180template<
typename T,
typename S>
183 output[0] = x[0]*
util::cos(x[1]) + _polarOrigin[0];
184 output[1] = x[0]*
util::sin(x[1]) + _polarOrigin[1];
190template<
typename T,
typename S>
192 T cartesianOriginY, T cartesianOriginZ,
193 T axisDirectionX, T axisDirectionY, T axisDirectionZ,
194 T orientationX, T orientationY, T orientationZ)
210template<
typename T,
typename S>
215 _cartesianOrigin(cartesianOrigin),
216 _axisDirection(axisDirection),
217 _orientation(orientation)
224template<
typename T,
typename S>
228 int dim = this->getSourceDim();
231 for (
int i = 0; i < dim; ++i) {
239 normalAxisDir =
normalize(normalAxisDir);
245 normal = _orientation;
250 T tmp[3] = {_axisDirection[0],_axisDirection[1],_axisDirection[2]};
263 rotRAxis(tmp2,x_tmp);
271 difference[0] = x_rot[0] - _cartesianOrigin[0];
272 difference[1] = x_rot[1] - _cartesianOrigin[1];
275 for (
int i = 0; i < 2; ++i) {
276 distance += difference[i]*difference[i];
282 if (distance > T()) {
286 T x_help[3] = {difference[0],difference[1],0.};
290 output[0] = distance;
AnalyticalF are applications from DD to XD, where X is set by the constructor.
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 calculates the angle alpha between vector _referenceVector and any other vector x.
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
std::string & getName()
read and write access to name
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)
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
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
This class saves coordinates of the resulting point after rotation in the output field.
Representation of a statistic for a parallel 2D geometry.
SuperGeometryStatistics< T, D > & getStatistics()
Returns the statistics object.
Conversion between physical and lattice units, as well as discretization.
This file contains two different classes of functors, in the FIRST part.
This file contains two different classes of functors, in the FIRST part.
The description of a generic interface for all functor classes – header file.
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
std::vector< T > fromVector3(const Vector< T, 3 > &vec)
ADf< T, DIM > sin(const ADf< T, DIM > &a)
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
ADf< T, DIM > cosh(const ADf< T, DIM > &a)
cpu::simd::Pack< T > fabs(cpu::simd::Pack< T > value)
bool nearZero(const ADf< T, DIM > &a)
ADf< T, DIM > cos(const ADf< T, DIM > &a)
Top level namespace for all of OpenLB.
constexpr T norm(const ScalarVector< T, D, IMPL > &a)
Euclidean vector norm.
constexpr Vector< T, 3 > crossProduct3D(const ScalarVector< T, 3, IMPL > &a, const ScalarVector< T, 3, IMPL_ > &b) any_platform
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})
Representation of a parallel 2D geometry – header file.
The description of a 2D super lattice – header file.