OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::HarmonicOscillatingRotatingForceField3D< 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::HarmonicOscillatingRotatingForceField3D< T, DESCRIPTOR >:
+ Collaboration diagram for olb::HarmonicOscillatingRotatingForceField3D< T, DESCRIPTOR >:

Public Member Functions

 HarmonicOscillatingRotatingForceField3D (SuperLattice< T, DESCRIPTOR > &sLattice_, SuperGeometry< T, 3 > &superGeometry_, const UnitConverter< T, DESCRIPTOR > &converter_, std::vector< T > axisPoint_, std::vector< T > axisDirection_, T amplitude_, T frequency_)
 
void updateTimeStep (int iT)
 
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
 
amplitude
 
resonanceFrequency
 
w
 
dwdt
 
SuperLatticePhysVelocity3D< T, DESCRIPTOR > velocity
 
- 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::HarmonicOscillatingRotatingForceField3D< 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 harmonic oscillation around an axis. Oscillation is determined by an amplitude and a frequency Functor for the rotation of forces.

Definition at line 103 of file latticeFrameChangeF3D.h.

Constructor & Destructor Documentation

◆ HarmonicOscillatingRotatingForceField3D()

template<typename T , typename DESCRIPTOR >
olb::HarmonicOscillatingRotatingForceField3D< T, DESCRIPTOR >::HarmonicOscillatingRotatingForceField3D ( SuperLattice< T, DESCRIPTOR > & sLattice_,
SuperGeometry< T, 3 > & superGeometry_,
const UnitConverter< T, DESCRIPTOR > & converter_,
std::vector< T > axisPoint_,
std::vector< T > axisDirection_,
T amplitude_,
T frequency_ )

Definition at line 92 of file latticeFrameChangeF3D.hh.

96 : SuperLatticeF3D<T,DESCRIPTOR>(sLattice_,3), sg(superGeometry_),
97 converter(converter_), axisPoint(axisPoint_), axisDirection(axisDirection_),
98 amplitude(amplitude_), resonanceFrequency(2.*4.*util::atan(1.0)*frequency_), w(0.0), dwdt(0.0),
99 velocity(sLattice_,converter_)
100{
101 this->getName() = "harmonicOscillatingrotatingForce";
102}
std::string & getName()
read and write access to name
Definition genericF.hh:51
SuperLatticePhysVelocity3D< T, DESCRIPTOR > velocity
const UnitConverter< T, DESCRIPTOR > & converter
ADf< T, DIM > atan(const ADf< T, DIM > &a)
Definition aDiff.h:614

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::HarmonicOscillatingRotatingForceField3D< T, DESCRIPTOR >::operator() ( T output[],
const int x[] )
override

Definition at line 113 of file latticeFrameChangeF3D.hh.

114{
115
116
117 std::vector<T> F_centri(3,0);
118 std::vector<T> F_coriolis(3,0);
119 std::vector<T> F_euler(3,0);
120
121 if ( this->_sLattice.getLoadBalancer().rank(x[0]) == singleton::mpi().getRank() ) {
122 // local coords are given, fetch local cell and compute value(s)
123 std::vector<T> physR(3,T());
124 this->sg.getCuboidGeometry().getPhysR(&(physR[0]),&(x[0]));
125
126 T scalar = (physR[0]-axisPoint[0])*axisDirection[0]
127 +(physR[1]-axisPoint[1])*axisDirection[1]
128 +(physR[2]-axisPoint[2])*axisDirection[2];
129
130 T r[3];
131 r[0] = physR[0]-axisPoint[0]-scalar*axisDirection[0];
132 r[1] = physR[1]-axisPoint[1]-scalar*axisDirection[1];
133 r[2] = physR[2]-axisPoint[2]-scalar*axisDirection[2];
134
135 F_centri[0] = w*w*(r[0]);
136 F_centri[1] = w*w*(r[1]);
137 F_centri[2] = w*w*(r[2]);
138
139 T _vel[3];
140 (velocity)(_vel,x);
141 F_coriolis[0] = -2*w*(axisDirection[1]*_vel[2]-axisDirection[2]*_vel[1]);
142 F_coriolis[1] = -2*w*(axisDirection[2]*_vel[0]-axisDirection[0]*_vel[2]);
143 F_coriolis[2] = -2*w*(axisDirection[0]*_vel[1]-axisDirection[1]*_vel[0]);
144
145 F_euler[0] = -dwdt*(axisDirection[1]*r[2]-axisDirection[2]*r[1]);
146 F_euler[1] = -dwdt*(axisDirection[2]*r[0]-axisDirection[0]*r[2]);
147 F_euler[2] = -dwdt*(axisDirection[0]*r[1]-axisDirection[1]*r[0]);
148
149
150 // return latticeForce
151 output[0] = (F_coriolis[0]+F_centri[0]+F_euler[0]) * converter.getConversionFactorTime() / converter.getConversionFactorVelocity();
152 output[1] = (F_coriolis[1]+F_centri[1]+F_euler[1]) * converter.getConversionFactorTime() / converter.getConversionFactorVelocity();
153 output[2] = (F_coriolis[2]+F_centri[2]+F_euler[2]) * converter.getConversionFactorTime() / converter.getConversionFactorVelocity();
154 }
155 return true;
156}
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:

◆ updateTimeStep()

template<typename T , typename DESCRIPTOR >
void olb::HarmonicOscillatingRotatingForceField3D< T, DESCRIPTOR >::updateTimeStep ( int iT)

Definition at line 105 of file latticeFrameChangeF3D.hh.

106{
109}
ADf< T, DIM > sin(const ADf< T, DIM > &a)
Definition aDiff.h:569
ADf< T, DIM > cos(const ADf< T, DIM > &a)
Definition aDiff.h:578

References olb::util::cos(), and olb::util::sin().

+ Here is the call graph for this function:

Member Data Documentation

◆ amplitude

template<typename T , typename DESCRIPTOR >
T olb::HarmonicOscillatingRotatingForceField3D< T, DESCRIPTOR >::amplitude
protected

Definition at line 109 of file latticeFrameChangeF3D.h.

◆ axisDirection

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

Definition at line 108 of file latticeFrameChangeF3D.h.

◆ axisPoint

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

Definition at line 107 of file latticeFrameChangeF3D.h.

◆ converter

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

Definition at line 106 of file latticeFrameChangeF3D.h.

◆ dwdt

template<typename T , typename DESCRIPTOR >
T olb::HarmonicOscillatingRotatingForceField3D< T, DESCRIPTOR >::dwdt
protected

Definition at line 112 of file latticeFrameChangeF3D.h.

◆ resonanceFrequency

template<typename T , typename DESCRIPTOR >
T olb::HarmonicOscillatingRotatingForceField3D< T, DESCRIPTOR >::resonanceFrequency
protected

Definition at line 110 of file latticeFrameChangeF3D.h.

◆ sg

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

Definition at line 105 of file latticeFrameChangeF3D.h.

◆ velocity

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

Definition at line 113 of file latticeFrameChangeF3D.h.

◆ w

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

Definition at line 111 of file latticeFrameChangeF3D.h.


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