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

Coupling of ADlattice[0] with the other AD lattices (tpartners) More...

#include <advectionDiffusionReactionCouplingPostProcessor2D.h>

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

Public Member Functions

 ConcentrationAdvectionDiffusionCouplingPostProcessor2D (int x0_, int x1_, int y0_, int y1_, const std::vector< T > &stochiometricCoeff_, const std::vector< T > latticeReactionCoeff_, const std::vector< T > &react_order_, 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.
 
void computeSources (T sources[], const T concentrations[])
 
- 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::ConcentrationAdvectionDiffusionCouplingPostProcessor2D< T, DESCRIPTOR >

Coupling of ADlattice[0] with the other AD lattices (tpartners)

Definition at line 45 of file advectionDiffusionReactionCouplingPostProcessor2D.h.

Constructor & Destructor Documentation

◆ ConcentrationAdvectionDiffusionCouplingPostProcessor2D()

template<typename T , typename DESCRIPTOR >
olb::ConcentrationAdvectionDiffusionCouplingPostProcessor2D< T, DESCRIPTOR >::ConcentrationAdvectionDiffusionCouplingPostProcessor2D ( int x0_,
int x1_,
int y0_,
int y1_,
const std::vector< T > & stochiometricCoeff_,
const std::vector< T > latticeReactionCoeff_,
const std::vector< T > & react_order_,
std::vector< BlockStructureD< 2 > * > partners_ )
inline

Definition at line 49 of file advectionDiffusionReactionCouplingPostProcessor2D.h.

55 : x0(x0_), x1(x1_), y0(y0_), y1(y1_),
56 stochiometricCoeff(stochiometricCoeff_),
57 latticeReactionCoeff(latticeReactionCoeff_),
58 react_order(react_order_), partners(partners_) {
59 this->getName() = "ConcentrationAdvectionDiffusionCouplingPostProcessor2D";
60 reaction_number = static_cast<int>(latticeReactionCoeff.size());
61 component_number = static_cast<int>(partners.size())+1;
62 for (int i = 0; i<component_number; i++) {
63 tpartners.emplace_back(
64 static_cast<BlockLattice<T,DESCRIPTOR> *>(partners[i]));
65 }
66 }
std::string & getName()
read and write access to name

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

+ Here is the call graph for this function:

Member Function Documentation

◆ computeSources()

template<typename T , typename DESCRIPTOR >
void olb::ConcentrationAdvectionDiffusionCouplingPostProcessor2D< T, DESCRIPTOR >::computeSources ( T sources[],
const T concentrations[] )
inline

Definition at line 113 of file advectionDiffusionReactionCouplingPostProcessor2D.h.

113 {
114 T lambda[reaction_number];
115 T reaction_rate;
116 for (int iter_reaction = 0; iter_reaction<reaction_number; ++iter_reaction) {
117 lambda[iter_reaction] = 0;
118 reaction_rate = 1;
119 for(int iter_component = 0; iter_component<component_number; ++iter_component) {
120 reaction_rate *= util::pow(concentrations[iter_component],
121 react_order[iter_reaction*component_number+iter_component]);
122 }
123 lambda[iter_reaction] = reaction_rate*latticeReactionCoeff[iter_reaction];
124 }
125
126 for (int iter_component = 0; iter_component<component_number; ++iter_component) {
127 sources[iter_component] = 0;
128 for (int iter_reaction = 0; iter_reaction<reaction_number; ++iter_reaction) {
129 sources[iter_component]
130 += stochiometricCoeff[iter_reaction*component_number+iter_component]*lambda[iter_reaction];
131 }
132 }
133 }
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112

References olb::util::pow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extent() [1/2]

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

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 68 of file advectionDiffusionReactionCouplingPostProcessor2D.h.

68 {
69 return 0;
70 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::ConcentrationAdvectionDiffusionCouplingPostProcessor2D< 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 72 of file advectionDiffusionReactionCouplingPostProcessor2D.h.

72 {
73 return 0;
74 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 76 of file advectionDiffusionReactionCouplingPostProcessor2D.h.

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

References olb::ConcentrationAdvectionDiffusionCouplingPostProcessor2D< T, DESCRIPTOR >::processSubDomain().

+ Here is the call graph for this function:

◆ processSubDomain()

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

Execute post-processing step on a sublattice.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 80 of file advectionDiffusionReactionCouplingPostProcessor2D.h.

81 {
82
83 int newX0, newX1, newY0, newY1;
84 if ( util::intersect (
85 x0, x1, y0, y1,
86 x0_, x1_, y0_, y1_,
87 newX0, newX1, newY0, newY1 ) ) {
88
89 for (int iX=newX0; iX<=newX1; ++iX) {
90 for (int iY=newY0; iY<=newY1; ++iY) {
91
92 //std::cout << "iX: " << iX << " iY: " << iY << std::endl;
93
94 T conc[component_number];
95 conc[0] = blockLattice.get(iX,iY).computeRho();
96 for (int iter_component = 1; iter_component<component_number; ++iter_component) {
97 conc[iter_component] = tpartners[iter_component-1]->get(iX,iY).computeRho();
98 }
99
100 T sources[component_number];
101 computeSources(sources, conc);
102
103 blockLattice.get(iX,iY).template setField<descriptors::SOURCE>(sources[0]);
104 for (int iter_component = 1; iter_component<component_number; ++iter_component) {
105 tpartners[iter_component-1]->get(iX,iY).template setField<descriptors::SOURCE>(
106 sources[iter_component]);
107 }
108 }
109 }
110 }
111 }
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::ConcentrationAdvectionDiffusionCouplingPostProcessor2D< T, DESCRIPTOR >::computeSources(), olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::util::intersect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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