OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::CirclePowerLaw3D< T > Class Template Reference

This functor returns a quadratic Poiseuille profile for use with a pipe with util::round cross-section. More...

#include <frameChangeF3D.h>

+ Inheritance diagram for olb::CirclePowerLaw3D< T >:
+ Collaboration diagram for olb::CirclePowerLaw3D< T >:

Public Member Functions

 CirclePowerLaw3D (olb::Vector< T, 3 > axisPoint, std::vector< T > axisDirection, T maxVelocity, T radius, T n, T scale=T(1))
 
 CirclePowerLaw3D (T center0, T center1, T center2, T normal0, T normal1, T normal2, T radius, T maxVelocity, T n, T scale=T(1))
 
 CirclePowerLaw3D (const SuperGeometry< T, 3 > &superGeometry, int material, T maxVelocity, T n, T distance2Wall, T scale=T(1))
 
 CirclePowerLaw3D (bool useMeanVelocity, std::vector< T > axisPoint, std::vector< T > axisDirection, T Velocity, T radius, T n, T scale=T(1))
 
 CirclePowerLaw3D (bool useMeanVelocity, T center0, T center1, T center2, T normal0, T normal1, T normal2, T radius, T Velocity, T n, T scale=T(1))
 
 CirclePowerLaw3D (bool useMeanVelocity, SuperGeometry< T, 3 > &superGeometry, int material, T Velocity, T n, T distance2Wall, T scale=T(1))
 
olb::Vector< T, 3 > getCenter ()
 Returns centerpoint vector.
 
std::vector< T > getNormal ()
 Returns normal vector.
 
getRadius ()
 Returns radi.
 
bool operator() (T output[], const T x[]) override
 
- Public Member Functions inherited from olb::AnalyticalF< D, T, S >
AnalyticalF< D, T, S > & operator- (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator+ (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator* (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator/ (AnalyticalF< D, T, S > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, S >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
virtual bool operator() (T output[], const S input[])=0
 has to be implemented for 'every' derived class
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], S input0)
 
bool operator() (T output[], S input0, S input1)
 
bool operator() (T output[], S input0, S input1, S input2)
 
bool operator() (T output[], S input0, S input1, S input2, S input3)
 

Protected Attributes

olb::Vector< T, 3 > _center
 
std::vector< T > _normal
 
_radius
 
_maxVelocity
 
_n
 
_scale
 

Additional Inherited Members

- Public Types inherited from olb::AnalyticalF< D, T, S >
using identity_functor_type = AnalyticalIdentity<D,T,S>
 
- Public Types inherited from olb::GenericF< T, S >
using targetType = T
 
using sourceType = S
 
- Public Attributes inherited from olb::GenericF< T, S >
std::shared_ptr< GenericF< T, S > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Static Public Attributes inherited from olb::AnalyticalF< D, T, S >
static constexpr unsigned dim = D
 
- Protected Member Functions inherited from olb::AnalyticalF< D, T, S >
 AnalyticalF (int n)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 

Detailed Description

template<typename T>
class olb::CirclePowerLaw3D< T >

This functor returns a quadratic Poiseuille profile for use with a pipe with util::round cross-section.

It uses cylinder coordinates and is valid for the entire length of the pipe.

This functor gives a parabolic velocity profile for a given point x as it computes the distance between x and the axis.

The axis is set in the input with axisPoint and axisDirection. The axisPoint can be the coordinate of any point where the axis passes. axisDirection has to be normed to 1. Once the axis is set in the middle of the pipe, the radius of the pipe "radius" and the velocity in the middle of the pipe "maxVelocity" determine the Poisseuille profile entierly. Velocity profile for util::round pipes and power law fluids: u(r)=u_max*(1-(r/R)^((n+1)/n)). The exponent n characterizes the fluid behavior. n<1: Pseudoplastic, n=1: Newtonian fluid, n>1: Dilatant

Definition at line 154 of file frameChangeF3D.h.

Constructor & Destructor Documentation

◆ CirclePowerLaw3D() [1/6]

template<typename T >
olb::CirclePowerLaw3D< T >::CirclePowerLaw3D ( olb::Vector< T, 3 > axisPoint,
std::vector< T > axisDirection,
T maxVelocity,
T radius,
T n,
T scale = T(1) )

Definition at line 166 of file frameChangeF3D.hh.

168 : AnalyticalF3D<T,T>(3), _center(center), _normal(util::normalize(normal)),
169 _radius(radius), _maxVelocity(maxVelocity), _n(n), _scale(scale) { }
std::vector< T > _normal
olb::Vector< T, 3 > _center
Vector< T, D > normalize(const Vector< T, D > &a)

◆ CirclePowerLaw3D() [2/6]

template<typename T >
olb::CirclePowerLaw3D< T >::CirclePowerLaw3D ( T center0,
T center1,
T center2,
T normal0,
T normal1,
T normal2,
T radius,
T maxVelocity,
T n,
T scale = T(1) )

Definition at line 172 of file frameChangeF3D.hh.

173 : AnalyticalF3D<T,T>(3), _radius(radius), _maxVelocity(maxVelocity), _n(n), _scale(scale)
174{
175// _center.push_back(center0);
176 _center[0] = center0;
177 _center[1] = center1;
178 _center[2] = center2;
179 std::vector<T> normalTmp;
180 normalTmp.push_back(normal0);
181 normalTmp.push_back(normal1);
182 normalTmp.push_back(normal2 );
183 _normal = normalTmp;
184}

References olb::CirclePowerLaw3D< T >::_center, and olb::CirclePowerLaw3D< T >::_normal.

◆ CirclePowerLaw3D() [3/6]

template<typename T >
olb::CirclePowerLaw3D< T >::CirclePowerLaw3D ( const SuperGeometry< T, 3 > & superGeometry,
int material,
T maxVelocity,
T n,
T distance2Wall,
T scale = T(1) )

Definition at line 187 of file frameChangeF3D.hh.

189 : AnalyticalF3D<T,T>(3), _maxVelocity(maxVelocity), _n(n), _scale(scale)
190{
191 _center = superGeometry.getStatistics().getCenterPhysR(material);
192 std::vector<T> normalTmp;
193 normalTmp.push_back(superGeometry.getStatistics().computeDiscreteNormal(material)[0]);
194 normalTmp.push_back(superGeometry.getStatistics().computeDiscreteNormal(material)[1]);
195 normalTmp.push_back(superGeometry.getStatistics().computeDiscreteNormal(material)[2]);
196 _normal = util::normalize(normalTmp);
197
198 // div. by 2 since one of the discrete redius directions is always 0 while the two other are not
199 _radius = T(distance2Wall);
200 for (int iD = 0; iD < 3; iD++) {
201 _radius += superGeometry.getStatistics().getPhysRadius(material)[iD]/2.;
202 }
203}
SuperGeometryStatistics< T, D > & getStatistics()
Returns the statistics object.

References olb::CirclePowerLaw3D< T >::_center, olb::CirclePowerLaw3D< T >::_normal, olb::CirclePowerLaw3D< T >::_radius, olb::SuperGeometry< T, D >::getStatistics(), and olb::util::normalize().

+ Here is the call graph for this function:

◆ CirclePowerLaw3D() [4/6]

template<typename T >
olb::CirclePowerLaw3D< T >::CirclePowerLaw3D ( bool useMeanVelocity,
std::vector< T > axisPoint,
std::vector< T > axisDirection,
T Velocity,
T radius,
T n,
T scale = T(1) )

Definition at line 206 of file frameChangeF3D.hh.

207 : CirclePowerLaw3D<T>(axisPoint, axisDirection, Velocity, radius, n, scale)
208{
209 if (useMeanVelocity) {
210 _maxVelocity = (2. + (1. + n)/n)/((1. + n)/n * util::pow(1.,(2. + (1. + n)/n))) * Velocity;
211 }
212}
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112

References olb::CirclePowerLaw3D< T >::_maxVelocity, and olb::util::pow().

+ Here is the call graph for this function:

◆ CirclePowerLaw3D() [5/6]

template<typename T >
olb::CirclePowerLaw3D< T >::CirclePowerLaw3D ( bool useMeanVelocity,
T center0,
T center1,
T center2,
T normal0,
T normal1,
T normal2,
T radius,
T Velocity,
T n,
T scale = T(1) )

Definition at line 215 of file frameChangeF3D.hh.

216 : CirclePowerLaw3D<T>(center0, center1, center2, normal0, normal1, normal2, radius, Velocity, n, scale)
217{
218 if (useMeanVelocity) {
219 _maxVelocity = (2. + (1. + n)/n)/((1. + n)/n * util::pow(1.,(2. + (1. + n)/n))) * Velocity;
220 }
221}

References olb::CirclePowerLaw3D< T >::_maxVelocity, and olb::util::pow().

+ Here is the call graph for this function:

◆ CirclePowerLaw3D() [6/6]

template<typename T >
olb::CirclePowerLaw3D< T >::CirclePowerLaw3D ( bool useMeanVelocity,
SuperGeometry< T, 3 > & superGeometry,
int material,
T Velocity,
T n,
T distance2Wall,
T scale = T(1) )

Definition at line 224 of file frameChangeF3D.hh.

225 : CirclePowerLaw3D<T>(superGeometry, material, Velocity, n, distance2Wall, scale)
226{
227 if (useMeanVelocity) {
228 _maxVelocity = (2. + (1. + n)/n)/((1. + n)/n * util::pow(1.,(2. + (1. + n)/n))) * Velocity;
229 }
230}

References olb::CirclePowerLaw3D< T >::_maxVelocity, and olb::util::pow().

+ Here is the call graph for this function:

Member Function Documentation

◆ getCenter()

template<typename T >
olb::Vector< T, 3 > olb::CirclePowerLaw3D< T >::getCenter ( )
inline

Returns centerpoint vector.

Definition at line 173 of file frameChangeF3D.h.

174 {
175 return _center;
176 };

References olb::CirclePowerLaw3D< T >::_center.

◆ getNormal()

template<typename T >
std::vector< T > olb::CirclePowerLaw3D< T >::getNormal ( )
inline

Returns normal vector.

Definition at line 178 of file frameChangeF3D.h.

179 {
180 return _normal;
181 };

References olb::CirclePowerLaw3D< T >::_normal.

◆ getRadius()

template<typename T >
T olb::CirclePowerLaw3D< T >::getRadius ( )
inline

Returns radi.

Definition at line 183 of file frameChangeF3D.h.

184 {
185 return _radius;
186 };

References olb::CirclePowerLaw3D< T >::_radius.

◆ operator()()

template<typename T >
bool olb::CirclePowerLaw3D< T >::operator() ( T output[],
const T x[] )
override

Definition at line 233 of file frameChangeF3D.hh.

234{
235 output[0] = _scale*_maxVelocity*_normal[0]*(1.-util::pow(util::sqrt((x[1]-_center[1])*(x[1]-_center[1])+(x[2]-_center[2])*(x[2]-_center[2]))/_radius, (_n + 1.)/_n));
236 output[1] = _scale*_maxVelocity*_normal[1]*(1.-util::pow(util::sqrt((x[0]-_center[0])*(x[0]-_center[0])+(x[2]-_center[2])*(x[2]-_center[2]))/_radius, (_n + 1.)/_n));
237 output[2] = _scale*_maxVelocity*_normal[2]*(1.-util::pow(util::sqrt((x[1]-_center[1])*(x[1]-_center[1])+(x[0]-_center[0])*(x[0]-_center[0]))/_radius, (_n + 1.)/_n));
238 return true;
239}
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100

References olb::util::pow(), and olb::util::sqrt().

+ Here is the call graph for this function:

Member Data Documentation

◆ _center

template<typename T >
olb::Vector<T, 3> olb::CirclePowerLaw3D< T >::_center
protected

Definition at line 156 of file frameChangeF3D.h.

◆ _maxVelocity

template<typename T >
T olb::CirclePowerLaw3D< T >::_maxVelocity
protected

Definition at line 159 of file frameChangeF3D.h.

◆ _n

template<typename T >
T olb::CirclePowerLaw3D< T >::_n
protected

Definition at line 160 of file frameChangeF3D.h.

◆ _normal

template<typename T >
std::vector<T> olb::CirclePowerLaw3D< T >::_normal
protected

Definition at line 157 of file frameChangeF3D.h.

◆ _radius

template<typename T >
T olb::CirclePowerLaw3D< T >::_radius
protected

Definition at line 158 of file frameChangeF3D.h.

◆ _scale

template<typename T >
T olb::CirclePowerLaw3D< T >::_scale
protected

Definition at line 161 of file frameChangeF3D.h.


The documentation for this class was generated from the following files: