OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::SmagorinskyBoussinesqCouplingPostProcessor3D< T, DESCRIPTOR > Class Template Reference

#include <navierStokesAdvectionDiffusionCouplingPostProcessor3D.h>

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

Public Member Functions

 SmagorinskyBoussinesqCouplingPostProcessor3D (int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, T smagoPrefactor_, std::vector< BlockStructureD< 3 > * > 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_, int z0_, int z1_) override
 Execute post-processing step on a sublattice.
 
- Public Member Functions inherited from olb::PostProcessor3D< T, DESCRIPTOR >
 PostProcessor3D ()
 
virtual ~PostProcessor3D ()
 
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::PostProcessor3D< T, DESCRIPTOR >
int _priority
 

Detailed Description

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

Definition at line 137 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

Constructor & Destructor Documentation

◆ SmagorinskyBoussinesqCouplingPostProcessor3D()

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

Definition at line 305 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

309 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_),
310 gravity(gravity_), T0(T0_), deltaTemp(deltaTemp_),
311 dir(dir_), PrTurb(PrTurb_), smagoPrefactor(smagoPrefactor_), partners(partners_)
312{
313 this->getName() = "SmagorinskyBoussinesqCouplingPostProcessor3D";
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::D3Q7<descriptors::VELOCITY,descriptors::TAU_EFF>>() / descriptors::invCs2<T,DESCRIPTOR>() / PrTurb;
329 tPartner = static_cast<BlockLattice<T,descriptors::D3Q7<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::PostProcessor3D< 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::SmagorinskyBoussinesqCouplingPostProcessor3D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 142 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

143 {
144 return 0;
145 }

◆ extent() [2/2]

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

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

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 146 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

147 {
148 return 0;
149 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 391 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

393{
394 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
395}
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.

◆ processSubDomain()

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

Execute post-processing step on a sublattice.

Molecular realaxation time

Turbulent realaxation time

Effective realaxation time

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 334 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

337{
338
339 int newX0, newX1, newY0, newY1, newZ0, newZ1;
340 if ( util::intersect (
341 x0, x1, y0, y1, z0, z1,
342 x0_, x1_, y0_, y1_, z0_, z1_,
343 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
344
345 for (int iX=newX0; iX<=newX1; ++iX) {
346 for (int iY=newY0; iY<=newY1; ++iY) {
347 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
348
349 // computation of the bousinessq force
350 auto force = blockLattice.get(iX,iY,iZ).template getFieldPointer<descriptors::FORCE>();
351 T temperatureDifference = tPartner->get(iX,iY,iZ).computeRho() - T0;
352 for (unsigned iD = 0; iD < L::d; ++iD) {
353 force[iD] = forcePrefactor[iD] * temperatureDifference;
354 }
355
356 // Velocity coupling
357 auto u = tPartner->get(iX,iY,iZ).template getField<descriptors::VELOCITY>();
358
359 // tau coupling
360 auto tauNS = blockLattice.get(iX,iY,iZ).template getFieldPointer<descriptors::TAU_EFF>();
361 auto tauAD = tPartner->get(iX,iY,iZ).template getFieldPointer<descriptors::TAU_EFF>();
362
364 blockLattice.get(iX,iY,iZ).computeAllMomenta(rho, u.data(), pi);
365 tPartner->get(iX,iY,iZ).template setField<descriptors::VELOCITY>(u);
366 T PiNeqNormSqr = pi[0]*pi[0] + 2.0*pi[1]*pi[1] + pi[2]*pi[2];
368 PiNeqNormSqr += pi[2]*pi[2] + pi[3]*pi[3] + 2*pi[4]*pi[4] +pi[5]*pi[5];
369 }
370 T PiNeqNorm = util::sqrt(PiNeqNormSqr);
372 T tau_mol_NS = 1. / blockLattice.get(iX,iY,iZ).getDynamics()->getParameters(blockLattice).template getOrFallback<descriptors::OMEGA>(0);
373 T tau_mol_AD = 1. / tPartner->get(iX,iY,iZ).getDynamics()->getParameters(*tPartner).template getOrFallback<descriptors::OMEGA>(0);
375 T tau_turb_NS = 0.5*(util::sqrt(tau_mol_NS*tau_mol_NS + smagoPrefactor/rho*PiNeqNorm) - tau_mol_NS);
376 if (tau_turb_NS != tau_turb_NS) {
377 tau_turb_NS = 0.0;
378 }
380 tauNS[0] = tau_mol_NS+tau_turb_NS;
381
382 T tau_turb_AD = tau_turb_NS * tauTurbADPrefactor;
383 tauAD[0] = tau_mol_AD+tau_turb_AD;
384 }
385 }
386 }
387 }
388}
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: