OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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 133 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 305 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

309 : x0(x0_), x1(x1_), y0(y0_), y1(y1_),
310 gravity(gravity_), T0(T0_), deltaTemp(deltaTemp_),
311 dir(dir_), PrTurb(PrTurb_), smagoPrefactor(smagoPrefactor_), partners(partners_)
312{
313 this->getName() = "SmagorinskyBoussinesqCouplingPostProcessor2D";
314 // we normalize the direction of force vector
315 T normDir = T();
316 for (unsigned iD = 0; iD < dir.size(); ++iD) {
317 normDir += dir[iD]*dir[iD];
318 }
319 normDir = util::sqrt(normDir);
320 for (unsigned iD = 0; iD < dir.size(); ++iD) {
321 dir[iD] /= normDir;
322 }
323
324 for (unsigned iD = 0; iD < dir.size(); ++iD) {
325 forcePrefactor[iD] = gravity * dir[iD];
326 }
327
328 tauTurbADPrefactor = descriptors::invCs2<T,descriptors::D2Q5<descriptors::VELOCITY,descriptors::TAU_EFF>>() / descriptors::invCs2<T,DESCRIPTOR>() / PrTurb;
329 tPartner = static_cast<BlockLattice<T,descriptors::D2Q5<descriptors::VELOCITY,descriptors::TAU_EFF>> *>(partners[0]);
330}
std::string & getName()
read and write access to name
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100

References olb::PostProcessor2D< T, DESCRIPTOR >::getName(), 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 138 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.h.

139 {
140 return 0;
141 }

◆ 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 142 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.h.

143 {
144 return 0;
145 }

◆ 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 385 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

387{
388 processSubDomain(blockLattice, x0, x1, y0, y1);
389}
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 333 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

336{
337
338 int newX0, newX1, newY0, newY1;
339 if ( util::intersect (
340 x0, x1, y0, y1,
341 x0_, x1_, y0_, y1_,
342 newX0, newX1, newY0, newY1 ) ) {
343
344 for (int iX=newX0; iX<=newX1; ++iX) {
345 for (int iY=newY0; iY<=newY1; ++iY) {
346
347 // computation of the bousinessq force
348 auto force = blockLattice.get(iX,iY).template getFieldPointer<descriptors::FORCE>();
349 T temperatureDifference = tPartner->get(iX,iY).computeRho() - T0;
350 for (unsigned iD = 0; iD < L::d; ++iD) {
351 force[iD] = forcePrefactor[iD] * temperatureDifference;
352 }
353
354 // Velocity coupling
355 auto u = tPartner->get(iX,iY).template getField<descriptors::VELOCITY>();
356 // tau coupling
357 auto tauNS = blockLattice.get(iX,iY).template getFieldPointer<descriptors::TAU_EFF>();
358 auto tauAD = tPartner->get(iX,iY).template getFieldPointer<descriptors::TAU_EFF>();
359
361 blockLattice.get(iX,iY).computeAllMomenta(rho, u.data(), pi);
362 tPartner->get(iX,iY).template setField<descriptors::VELOCITY>(u);
363 T PiNeqNormSqr = pi[0]*pi[0] + 2.0*pi[1]*pi[1] + pi[2]*pi[2];
365 PiNeqNormSqr += pi[2]*pi[2] + pi[3]*pi[3] + 2*pi[4]*pi[4] +pi[5]*pi[5];
366 }
367 T PiNeqNorm = util::sqrt(PiNeqNormSqr);
369 T tau_mol_NS = 1. / blockLattice.get(iX,iY).getDynamics()->getParameters(blockLattice).template getOrFallback<descriptors::OMEGA>(0);
370 T tau_mol_AD = 1. / tPartner->get(iX,iY).getDynamics()->getParameters(*tPartner).template getOrFallback<descriptors::OMEGA>(0);
372 T tau_turb_NS = 0.5*(util::sqrt(tau_mol_NS*tau_mol_NS + smagoPrefactor/rho*PiNeqNorm) - tau_mol_NS);
374 tauNS[0] = tau_mol_NS+tau_turb_NS;
375
376 T tau_turb_AD = tau_turb_NS * tauTurbADPrefactor;
377 tauAD[0] = tau_mol_AD+tau_turb_AD;
378 }
379 }
380 }
381
382}
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:89
static constexpr int n
result stored in n
Definition util.h:211

References olb::BlockLattice< T, DESCRIPTOR >::get(), 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: