OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
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, T > & operator- (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator+ (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator* (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator/ (SuperF3D< T, T > &rhs)
 
SuperStructure< T, 3 > & getSuperStructure ()
 
int getBlockFSize () const
 
BlockF3D< T > & getBlockF (int iCloc)
 
bool operator() (T output[], const int input[])
 
- 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

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< T > > > _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< 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::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< T, S >
 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 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()
read and write access to name
Definition genericF.hh:51
SuperLatticeDensity3D< T, DESCRIPTOR > rho
const UnitConverter< T, DESCRIPTOR > & converter
SuperGeometry< T, 3 > & sg
SuperLatticePhysVelocity3D< T, DESCRIPTOR > velocity

References olb::GenericF< T, S >::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.getCuboidGeometry().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
CuboidGeometry< T, D > & getCuboidGeometry()
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: