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

#include <navierStokesAdvectionDiffusionCouplingPostProcessor2D.h>

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

Public Member Functions

 SmagorinskyBoussinesqCouplingPostProcessor2D (int x0_, int x1_, int y0_, int y1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, T smagoPrefactor_, std::vector< BlockStructureD< 2 > * > partners_)
 
int extent () const override
 Extent of application area (0 for purely local operations)
 
int extent (int whichDirection) const override
 Extent of application area along a direction (0 or 1)
 
void process (BlockLattice< T, DESCRIPTOR > &blockLattice) override
 Execute post-processing step.
 
void processSubDomain (BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
 Execute post-processing step on a sublattice.
 
- Public Member Functions inherited from olb::PostProcessor2D< T, DESCRIPTOR >
 PostProcessor2D ()
 
virtual ~PostProcessor2D ()
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
int getPriority () const
 read only access to priority
 

Additional Inherited Members

- Protected Attributes inherited from olb::PostProcessor2D< T, DESCRIPTOR >
int _priority
 

Detailed Description

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

Definition at line 88 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.h.

Constructor & Destructor Documentation

◆ SmagorinskyBoussinesqCouplingPostProcessor2D()

template<typename T , typename DESCRIPTOR >
olb::SmagorinskyBoussinesqCouplingPostProcessor2D< T, DESCRIPTOR >::SmagorinskyBoussinesqCouplingPostProcessor2D ( int x0_,
int x1_,
int y0_,
int y1_,
T gravity_,
T T0_,
T deltaTemp_,
std::vector< T > dir_,
T PrTurb_,
T smagoPrefactor_,
std::vector< BlockStructureD< 2 > * > partners_ )

Definition at line 201 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

205 : x0(x0_), x1(x1_), y0(y0_), y1(y1_),
206 gravity(gravity_), T0(T0_), deltaTemp(deltaTemp_),
207 dir(dir_), PrTurb(PrTurb_), smagoPrefactor(smagoPrefactor_), partners(partners_)
208{
209 this->getName() = "SmagorinskyBoussinesqCouplingPostProcessor2D";
210 // we normalize the direction of force vector
211 T normDir = T();
212 for (unsigned iD = 0; iD < dir.size(); ++iD) {
213 normDir += dir[iD]*dir[iD];
214 }
215 normDir = util::sqrt(normDir);
216 for (unsigned iD = 0; iD < dir.size(); ++iD) {
217 dir[iD] /= normDir;
218 }
219
220 for (unsigned iD = 0; iD < dir.size(); ++iD) {
221 forcePrefactor[iD] = gravity * dir[iD];
222 }
223
225 tPartner = static_cast<BlockLattice<T,descriptors::D2Q5<descriptors::VELOCITY,descriptors::TAU_EFF>> *>(partners[0]);
226}
std::string & getName()
read and write access to name
constexpr T invCs2() any_platform
Definition functions.h:107
Expr sqrt(Expr x)
Definition expr.cpp:225

References olb::PostProcessor2D< T, DESCRIPTOR >::getName(), olb::descriptors::invCs2(), and olb::util::sqrt().

+ Here is the call graph for this function:

Member Function Documentation

◆ extent() [1/2]

template<typename T , typename DESCRIPTOR >
int olb::SmagorinskyBoussinesqCouplingPostProcessor2D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 93 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.h.

94 {
95 return 0;
96 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::SmagorinskyBoussinesqCouplingPostProcessor2D< T, DESCRIPTOR >::extent ( int direction) const
inlineoverridevirtual

Extent of application area along a direction (0 or 1)

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 97 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.h.

98 {
99 return 0;
100 }

◆ process()

template<typename T , typename DESCRIPTOR >
void olb::SmagorinskyBoussinesqCouplingPostProcessor2D< T, DESCRIPTOR >::process ( BlockLattice< T, DESCRIPTOR > & blockLattice)
overridevirtual

Execute post-processing step.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 281 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

283{
284 processSubDomain(blockLattice, x0, x1, y0, y1);
285}
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.

◆ processSubDomain()

template<typename T , typename DESCRIPTOR >
void olb::SmagorinskyBoussinesqCouplingPostProcessor2D< T, DESCRIPTOR >::processSubDomain ( BlockLattice< T, DESCRIPTOR > & blockLattice,
int x0_,
int x1_,
int y0_,
int y1_ )
overridevirtual

Execute post-processing step on a sublattice.

Molecular realaxation time

Turbulent realaxation time

Effective realaxation time

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 229 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

232{
233
234 int newX0, newX1, newY0, newY1;
235 if ( util::intersect (
236 x0, x1, y0, y1,
237 x0_, x1_, y0_, y1_,
238 newX0, newX1, newY0, newY1 ) ) {
239
240 for (int iX=newX0; iX<=newX1; ++iX) {
241 for (int iY=newY0; iY<=newY1; ++iY) {
242
243 // computation of the bousinessq force
244 auto force = blockLattice.get(iX,iY).template getFieldPointer<descriptors::FORCE>();
245 T temperatureDifference = tPartner->get(iX,iY).computeRho() - T0;
246 for (unsigned iD = 0; iD < L::d; ++iD) {
247 force[iD] = forcePrefactor[iD] * temperatureDifference;
248 }
249
250 // Velocity coupling
251 auto u = tPartner->get(iX,iY).template getField<descriptors::VELOCITY>();
252 // tau coupling
253 auto tauNS = blockLattice.get(iX,iY).template getFieldPointer<descriptors::TAU_EFF>();
254 auto tauAD = tPartner->get(iX,iY).template getFieldPointer<descriptors::TAU_EFF>();
255
257 blockLattice.get(iX,iY).computeAllMomenta(rho, u.data(), pi);
258 tPartner->get(iX,iY).template setField<descriptors::VELOCITY>(u);
259 T PiNeqNormSqr = pi[0]*pi[0] + 2.0*pi[1]*pi[1] + pi[2]*pi[2];
261 PiNeqNormSqr += pi[2]*pi[2] + pi[3]*pi[3] + 2*pi[4]*pi[4] +pi[5]*pi[5];
262 }
263 T PiNeqNorm = util::sqrt(PiNeqNormSqr);
265 T tau_mol_NS = 1. / blockLattice.get(iX,iY).getDynamics()->getParameters(blockLattice).template getOrFallback<descriptors::OMEGA>(0);
266 T tau_mol_AD = 1. / tPartner->get(iX,iY).getDynamics()->getParameters(*tPartner).template getOrFallback<descriptors::OMEGA>(0);
268 T tau_turb_NS = 0.5*(util::sqrt(tau_mol_NS*tau_mol_NS + smagoPrefactor/rho*PiNeqNorm) - tau_mol_NS);
270 tauNS[0] = tau_mol_NS+tau_turb_NS;
271
272 T tau_turb_AD = tau_turb_NS * tauTurbADPrefactor;
273 tauAD[0] = tau_mol_AD+tau_turb_AD;
274 }
275 }
276 }
277
278}
bool intersect(int x0, int x1, int y0, int y1, int x0_, int x1_, int y0_, int y1_, int &newX0, int &newX1, int &newY0, int &newY1)
Definition util.h:85
static constexpr int n
result stored in n
Definition util.h:217

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

+ Here is the call graph for this function:

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