OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::RotatingForceField3D< T, DESCRIPTOR > Class Template Referencefinal

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

#include <latticeFrameChangeF3D.h>

+ Inheritance diagram for olb::RotatingForceField3D< T, DESCRIPTOR >:
+ Collaboration diagram for olb::RotatingForceField3D< T, DESCRIPTOR >:

Public Member Functions

 RotatingForceField3D (SuperLattice< T, DESCRIPTOR > &sLattice_, SuperGeometry< T, 3 > &superGeometry_, const UnitConverter< T, DESCRIPTOR > &converter_, std::vector< T > axisPoint_, std::vector< T > axisDirection_, T w_, bool centrifugeForceOn_=true, bool coriolisForceOn_=true)
 
bool operator() (T output[], const int x[]) override
 
- Public Member Functions inherited from olb::SuperLatticeF3D< T, DESCRIPTOR >
SuperLattice< T, DESCRIPTOR > & getSuperLattice ()
 
bool operator() (T output[], const int input[])
 
- Public Member Functions inherited from olb::SuperF3D< T, T >
SuperF3D< T, W > & operator- (SuperF3D< T, W > &rhs)
 
SuperF3D< T, W > & operator+ (SuperF3D< T, W > &rhs)
 
SuperF3D< T, W > & operator* (SuperF3D< T, W > &rhs)
 
SuperF3D< T, W > & operator/ (SuperF3D< T, W > &rhs)
 
SuperStructure< T, 3 > & getSuperStructure ()
 
int getBlockFSize () const
 
BlockF3D< W > & getBlockF (int iCloc)
 
bool operator() (W output[], const int input[])
 has to be implemented for 'every' derived class
 
- Public Member Functions inherited from olb::GenericF< W, int >
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
 
bool operator() (W output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (W output[], int input0)
 
bool operator() (W output[], int input0, int input1)
 
bool operator() (W output[], int input0, int input1, int input2)
 
bool operator() (W output[], int input0, int input1, int input2, int input3)
 

Protected Attributes

SuperGeometry< T, 3 > & sg
 
const UnitConverter< T, DESCRIPTOR > & converter
 
std::vector< T > axisPoint
 
std::vector< T > axisDirection
 
w
 
bool centrifugeForceOn
 
bool coriolisForceOn
 
SuperLatticePhysVelocity3D< T, DESCRIPTOR > velocity
 
SuperLatticeDensity3D< T, DESCRIPTOR > rho
 
- Protected Attributes inherited from olb::SuperLatticeF3D< T, DESCRIPTOR >
SuperLattice< T, DESCRIPTOR > & _sLattice
 
- Protected Attributes inherited from olb::SuperF3D< T, T >
SuperStructure< T, 3 > & _superStructure
 
std::vector< std::unique_ptr< BlockF3D< W > > > _blockF
 Super functors may consist of several BlockF3D<W> derived functors.
 

Additional Inherited Members

- Public Types inherited from olb::SuperLatticeF3D< T, DESCRIPTOR >
using identity_functor_type = SuperLatticeIdentity3D<T,DESCRIPTOR>
 
- Public Types inherited from olb::SuperF3D< T, T >
using identity_functor_type
 
- Public Types inherited from olb::GenericF< W, int >
using targetType
 
using sourceType
 
- Public Attributes inherited from olb::GenericF< W, int >
std::shared_ptr< GenericF< W, int > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Static Public Attributes inherited from olb::SuperF3D< T, T >
static constexpr bool isSuper
 
static constexpr unsigned d
 
- Protected Member Functions inherited from olb::SuperLatticeF3D< T, DESCRIPTOR >
 SuperLatticeF3D (SuperLattice< T, DESCRIPTOR > &superLattice, int targetDim)
 
- Protected Member Functions inherited from olb::SuperF3D< T, T >
 SuperF3D (SuperStructure< T, 3 > &superStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< W, int >
 GenericF (int targetDim, int sourceDim)
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::RotatingForceField3D< T, DESCRIPTOR >

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

The forces set are the fake forces caused by a non-Galilean frame, here rotating around an axis with a pulse w. There are:

  • The centrifuge force F = rho * w * w * (x-hx, y-hy, z-hz) | where (hx, hy, hz) is the projection of the point on the axis.
  • The coriolis force F = -2 * rho * w * (vx, vy, vz)°(Dx, Dy, Dz) | where ° is the vector product and (Dx, Dy, Dz) is the direction vector of the axis normed to 1 (named axisDirection in the code)

The boolean terms enable to choose having centrifugue or coriolis forces too or not. Functor for the rotation of forces.

Definition at line 66 of file latticeFrameChangeF3D.h.

Constructor & Destructor Documentation

◆ RotatingForceField3D()

template<typename T , typename DESCRIPTOR >
olb::RotatingForceField3D< T, DESCRIPTOR >::RotatingForceField3D ( SuperLattice< T, DESCRIPTOR > & sLattice_,
SuperGeometry< T, 3 > & superGeometry_,
const UnitConverter< T, DESCRIPTOR > & converter_,
std::vector< T > axisPoint_,
std::vector< T > axisDirection_,
T w_,
bool centrifugeForceOn_ = true,
bool coriolisForceOn_ = true )

Definition at line 41 of file latticeFrameChangeF3D.hh.

46 : SuperLatticeF3D<T,DESCRIPTOR>(sLattice_,3), sg(superGeometry_),
47 converter(converter_), axisPoint(axisPoint_), axisDirection(axisDirection_),
48 w(w_), centrifugeForceOn(centrifugeForceOn_), coriolisForceOn(coriolisForceOn_),
49 velocity(sLattice_,converter_), rho(sLattice_)
50{
51 this->getName() = "rotatingForce";
52}
std::string & getName()
Definition genericF.hh:51
SuperLatticeDensity3D< T, DESCRIPTOR > rho
const UnitConverter< T, DESCRIPTOR > & converter
SuperGeometry< T, 3 > & sg
SuperLatticePhysVelocity3D< T, DESCRIPTOR > velocity
SuperLatticeF3D(SuperLattice< T, DESCRIPTOR > &superLattice, int targetDim)

References olb::GenericF< W, int >::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

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

Definition at line 56 of file latticeFrameChangeF3D.hh.

57{
58 std::vector<T> F_centri(3,0);
59 std::vector<T> F_coriolis(3,0);
60
61 if ( this->_sLattice.getLoadBalancer().rank(x[0]) == singleton::mpi().getRank() ) {
62 // local coords are given, fetch local cell and compute value(s)
63 std::vector<T> physR(3,T());
64 this->sg.getCuboidDecomposition().getPhysR(&(physR[0]),&(x[0]));
65
66 T scalar = (physR[0]-axisPoint[0])*axisDirection[0]
67 +(physR[1]-axisPoint[1])*axisDirection[1]
68 +(physR[2]-axisPoint[2])*axisDirection[2];
69
71 F_centri[0] = w*w*(physR[0]-axisPoint[0]-scalar*axisDirection[0]);
72 F_centri[1] = w*w*(physR[1]-axisPoint[1]-scalar*axisDirection[1]);
73 F_centri[2] = w*w*(physR[2]-axisPoint[2]-scalar*axisDirection[2]);
74 }
75 if (coriolisForceOn) {
76 T _vel[3];
77 (velocity)(_vel,x);
78 F_coriolis[0] = -2*w*(axisDirection[1]*_vel[2]-axisDirection[2]*_vel[1]);
79 F_coriolis[1] = -2*w*(axisDirection[2]*_vel[0]-axisDirection[0]*_vel[2]);
80 F_coriolis[2] = -2*w*(axisDirection[0]*_vel[1]-axisDirection[1]*_vel[0]);
81 }
82 // return latticeForce
83 output[0] = (F_coriolis[0]+F_centri[0]) * converter.getConversionFactorTime() / converter.getConversionFactorVelocity();
84 output[1] = (F_coriolis[1]+F_centri[1]) * converter.getConversionFactorTime() / converter.getConversionFactorVelocity();
85 output[2] = (F_coriolis[2]+F_centri[2]) * converter.getConversionFactorTime() / converter.getConversionFactorVelocity();
86 }
87 return true;
88}
SuperLattice< T, DESCRIPTOR > & _sLattice
CuboidDecomposition< T, D > & getCuboidDecomposition()
Read and write access to cuboid geometry.
int getRank() const
Returns the process ID.
MpiManager & mpi()

References olb::singleton::MpiManager::getRank(), and olb::singleton::mpi().

+ Here is the call graph for this function:

Member Data Documentation

◆ axisDirection

template<typename T , typename DESCRIPTOR >
std::vector<T> olb::RotatingForceField3D< T, DESCRIPTOR >::axisDirection
protected

Definition at line 71 of file latticeFrameChangeF3D.h.

◆ axisPoint

template<typename T , typename DESCRIPTOR >
std::vector<T> olb::RotatingForceField3D< T, DESCRIPTOR >::axisPoint
protected

Definition at line 70 of file latticeFrameChangeF3D.h.

◆ centrifugeForceOn

template<typename T , typename DESCRIPTOR >
bool olb::RotatingForceField3D< T, DESCRIPTOR >::centrifugeForceOn
protected

Definition at line 73 of file latticeFrameChangeF3D.h.

◆ converter

template<typename T , typename DESCRIPTOR >
const UnitConverter<T,DESCRIPTOR>& olb::RotatingForceField3D< T, DESCRIPTOR >::converter
protected

Definition at line 69 of file latticeFrameChangeF3D.h.

◆ coriolisForceOn

template<typename T , typename DESCRIPTOR >
bool olb::RotatingForceField3D< T, DESCRIPTOR >::coriolisForceOn
protected

Definition at line 74 of file latticeFrameChangeF3D.h.

◆ rho

template<typename T , typename DESCRIPTOR >
SuperLatticeDensity3D<T, DESCRIPTOR> olb::RotatingForceField3D< T, DESCRIPTOR >::rho
protected

Definition at line 76 of file latticeFrameChangeF3D.h.

◆ sg

template<typename T , typename DESCRIPTOR >
SuperGeometry<T,3>& olb::RotatingForceField3D< T, DESCRIPTOR >::sg
protected

Definition at line 68 of file latticeFrameChangeF3D.h.

◆ velocity

template<typename T , typename DESCRIPTOR >
SuperLatticePhysVelocity3D<T, DESCRIPTOR> olb::RotatingForceField3D< T, DESCRIPTOR >::velocity
protected

Definition at line 75 of file latticeFrameChangeF3D.h.

◆ w

template<typename T , typename DESCRIPTOR >
T olb::RotatingForceField3D< T, DESCRIPTOR >::w
protected

Definition at line 72 of file latticeFrameChangeF3D.h.


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