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

PostProcessor for setting a constant density outlet. More...

#include <freeEnergyPostProcessor2D.h>

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

Public Member Functions

 FreeEnergyDensityOutletCoupling2D (int x0_, int x1_, int y0_, int y1_, T rho_, std::vector< BlockStructureD< 2 > * > partners_)
 
 FreeEnergyDensityOutletCoupling2D (T rho_, 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::FreeEnergyDensityOutletCoupling2D< T, DESCRIPTOR >

PostProcessor for setting a constant density outlet.

This should be used before the bulk chemical potential post- processor because it depends upon the result of this.

Definition at line 141 of file freeEnergyPostProcessor2D.h.

Constructor & Destructor Documentation

◆ FreeEnergyDensityOutletCoupling2D() [1/2]

template<typename T , typename DESCRIPTOR >
olb::FreeEnergyDensityOutletCoupling2D< T, DESCRIPTOR >::FreeEnergyDensityOutletCoupling2D ( int x0_,
int x1_,
int y0_,
int y1_,
T rho_,
std::vector< BlockStructureD< 2 > * > partners_ )
Parameters
[in]rho_- Gives the value of the density constraint.
[in]partners_- Contains one partner lattice for two fluid components, or two lattices for three components.

Definition at line 343 of file freeEnergyPostProcessor2D.hh.

346 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), rho(rho_), partners(partners_)
347{
348 this->getName() = "FreeEnergyDensityOutletCoupling2D";
349}
std::string & getName()
read and write access to name

References olb::PostProcessor2D< T, DESCRIPTOR >::getName().

+ Here is the call graph for this function:

◆ FreeEnergyDensityOutletCoupling2D() [2/2]

template<typename T , typename DESCRIPTOR >
olb::FreeEnergyDensityOutletCoupling2D< T, DESCRIPTOR >::FreeEnergyDensityOutletCoupling2D ( T rho_,
std::vector< BlockStructureD< 2 > * > partners_ )
Parameters
[in]rho_- Gives the value of the density constraint.
[in]partners_- Contains one partner lattice for two fluid components, or two lattices for three components.

Definition at line 352 of file freeEnergyPostProcessor2D.hh.

354 : x0(0), x1(0), y0(0), y1(0), rho(rho_), partners(partners_)
355{
356 this->getName() = "FreeEnergyDensityOutletCoupling2D";
357}

References olb::PostProcessor2D< T, DESCRIPTOR >::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ extent() [1/2]

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

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 150 of file freeEnergyPostProcessor2D.h.

151 {
152 return 0;
153 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::FreeEnergyDensityOutletCoupling2D< 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 154 of file freeEnergyPostProcessor2D.h.

155 {
156 return 0;
157 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 392 of file freeEnergyPostProcessor2D.hh.

394{
395 processSubDomain(blockLattice, x0, x1, y0, y1);
396}
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::FreeEnergyDensityOutletCoupling2D< T, DESCRIPTOR >::processSubDomain ( BlockLattice< T, DESCRIPTOR > & blockLattice,
int x0_,
int x1_,
int y0_,
int y1_ )
overridevirtual

Execute post-processing step on a sublattice.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 360 of file freeEnergyPostProcessor2D.hh.

362{
363 // If partners.size() == 1: two fluid components
364 // If partners.size() == 2: three fluid components
365 BlockLattice<T,DESCRIPTOR> *partnerLattice1 = static_cast<BlockLattice<T,DESCRIPTOR> *>(partners[0]);
366 BlockLattice<T,DESCRIPTOR> *partnerLattice2 = nullptr;
367 if (partners.size() > 1) {
368 partnerLattice2 = static_cast<BlockLattice<T,DESCRIPTOR> *>(partners[1]);
369 }
370
371 int newX0, newX1, newY0, newY1;
372 if ( util::intersect ( x0, x1, y0, y1,
373 x0_, x1_, y0_, y1_,
374 newX0, newX1, newY0, newY1 ) ) {
375 for (int iX=newX0; iX<=newX1; ++iX) {
376 for (int iY=newY0; iY<=newY1; ++iY) {
377 T rho0, phi, psi;
378 rho0 = blockLattice.get(iX,iY).computeRho();
379 phi = partnerLattice1->get(iX,iY).computeRho();
380 blockLattice.get(iX,iY).defineRho(rho);
381 partnerLattice1->get(iX,iY).defineRho(phi * rho / rho0);
382 if (partners.size() > 1) {
383 psi = partnerLattice2->get(iX,iY).computeRho();
384 partnerLattice2->get(iX,iY).defineRho(psi * rho / rho0);
385 }
386 }
387 }
388 }
389}
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: