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

#include <navierStokesAdvectionDiffusionCouplingPostProcessor3D.h>

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

Public Member Functions

 PorousNavierStokesAdvectionDiffusionCouplingPostProcessor3D (int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, 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::PorousNavierStokesAdvectionDiffusionCouplingPostProcessor3D< T, DESCRIPTOR >

Definition at line 258 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

Constructor & Destructor Documentation

◆ PorousNavierStokesAdvectionDiffusionCouplingPostProcessor3D()

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

Definition at line 597 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

601 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_),
602 gravity(gravity_), T0(T0_), deltaTemp(deltaTemp_),
603 dir(dir_), partners(partners_)
604{
605 this->getName() = "PorousNavierStokesAdvectionDiffusionCouplingPostProcessor3D";
606 // we normalize the direction of force vector
607 T normDir = T();
608 for (unsigned iD = 0; iD < dir.size(); ++iD) {
609 normDir += dir[iD]*dir[iD];
610 }
611 normDir = util::sqrt(normDir);
612 for (unsigned iD = 0; iD < dir.size(); ++iD) {
613 dir[iD] /= normDir;
614 }
615}
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::PorousNavierStokesAdvectionDiffusionCouplingPostProcessor3D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 265 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

266 {
267 return 1;
268 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::PorousNavierStokesAdvectionDiffusionCouplingPostProcessor3D< 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 269 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

270 {
271 return 1;
272 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 658 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

660{
661 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
662}
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::PorousNavierStokesAdvectionDiffusionCouplingPostProcessor3D< 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.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 618 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

621{
622 typedef DESCRIPTOR L;
623 enum {x,y,z};
624
625 BlockLattice<T,descriptors::PorousAdvectionDiffusionD3Q7Descriptor> *tPartner =
626 static_cast<BlockLattice<T,descriptors::PorousAdvectionDiffusionD3Q7Descriptor> *>(partners[0]);
627
628 int newX0, newX1, newY0, newY1, newZ0, newZ1;
629 if ( util::intersect (
630 x0, x1, y0, y1, z0, z1,
631 x0_, x1_, y0_, y1_, z0_, z1_,
632 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
633
634 for (int iX=newX0; iX<=newX1; ++iX) {
635 for (int iY=newY0; iY<=newY1; ++iY) {
636 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
637 // Velocity coupling
638 auto u = tPartner->get(iX,iY,iZ).template getField<descriptors::VELOCITY>();
639 blockLattice.get(iX,iY,iZ).computeU(u.data());
640 tPartner->get(iX,iY,iZ).template setField<descriptors::VELOCITY>(u);
641
642 //coupling between the temperature and navier stokes.
643
644 auto force = blockLattice.get(iX,iY,iZ).template getFieldPointer<descriptors::FORCE>();
645 // this should return the interpolated solid-fluid temperature
646 T temperature = tPartner->get(iX,iY,iZ).computeRho();
647 T rho = blockLattice.get(iX,iY,iZ).computeRho();
648 for (unsigned iD = 0; iD < L::d; ++iD) {
649 force[iD] = gravity * rho * (temperature - T0) / deltaTemp * dir[iD];
650 }
651 }
652 }
653 }
654 }
655}
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

References olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::util::intersect().

+ Here is the call graph for this function:

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