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

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

#include <advectionDiffusionReactionCouplingPostProcessor3D.h>

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

Public Member Functions

 ConcentrationAdvectionDiffusionCouplingPostProcessor3D (int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, const std::vector< T > &stoichiometricCoeff_, const std::vector< T > latticeReactionCoeff_, const std::vector< T > &react_order_, 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::ConcentrationAdvectionDiffusionCouplingPostProcessor3D< T, DESCRIPTOR >

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

Definition at line 45 of file advectionDiffusionReactionCouplingPostProcessor3D.h.

Constructor & Destructor Documentation

◆ ConcentrationAdvectionDiffusionCouplingPostProcessor3D()

template<typename T , typename DESCRIPTOR >
olb::ConcentrationAdvectionDiffusionCouplingPostProcessor3D< T, DESCRIPTOR >::ConcentrationAdvectionDiffusionCouplingPostProcessor3D ( int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
const std::vector< T > & stoichiometricCoeff_,
const std::vector< T > latticeReactionCoeff_,
const std::vector< T > & react_order_,
std::vector< BlockStructureD< 3 > * > partners_ )
inline

Definition at line 49 of file advectionDiffusionReactionCouplingPostProcessor3D.h.

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ extent() [1/2]

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

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 66 of file advectionDiffusionReactionCouplingPostProcessor3D.h.

66 {
67 return 0;
68 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::ConcentrationAdvectionDiffusionCouplingPostProcessor3D< 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 70 of file advectionDiffusionReactionCouplingPostProcessor3D.h.

70 {
71 return 0;
72 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 74 of file advectionDiffusionReactionCouplingPostProcessor3D.h.

74 {
75 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
76 }
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.

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

+ Here is the call graph for this function:

◆ processSubDomain()

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

Execute post-processing step on a sublattice.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 78 of file advectionDiffusionReactionCouplingPostProcessor3D.h.

79 {
80
81 int newX0, newX1, newY0, newY1, newZ0, newZ1;
82 if ( util::intersect (
83 x0, x1, y0, y1, z0, z1,
84 x0_, x1_, y0_, y1_, z0_, z1_,
85 newX0, newX1, newY0, newY1, newZ0, newZ1) ) {
86
87 for (int iX=newX0; iX<=newX1; ++iX) {
88 for (int iY=newY0; iY<=newY1; ++iY) {
89 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
90
91 std::vector<T> conc;
92 conc.emplace_back(blockLattice.get(iX,iY, iZ).computeRho());
93 for (int iter_component = 0; iter_component<component_number-1; ++ iter_component){
94 conc.emplace_back(tpartners[iter_component]->get(iX,iY,iZ).computeRho());
95 }
96
97 T lambda[reaction_number];
98 T reaction_rate;
99 for (int iter_reaction = 0; iter_reaction<reaction_number; ++ iter_reaction){
100 lambda[iter_reaction] = 0;
101 reaction_rate = 1;
102 for(int iter_component = 0; iter_component <component_number; ++ iter_component){
103
104 reaction_rate = reaction_rate*(util::pow(conc[iter_component],react_order[iter_reaction*component_number+iter_component]));
105 }
106
107 lambda[iter_reaction] = reaction_rate*latticeReactionCoeff[iter_reaction];
108 }
109 T temp_source;
110 for (int iter_component = 0; iter_component<component_number; ++ iter_component){
111 temp_source = 0;
112 for (int iter_reaction = 0; iter_reaction<reaction_number; ++ iter_reaction){
113 temp_source = temp_source + stoichiometricCoeff[iter_reaction*component_number+iter_component]*lambda[iter_reaction];
114 }
115 if (iter_component == 0){
116 blockLattice.get(iX,iY,iZ).template setField<descriptors::SOURCE>(
117 temp_source);
118 }
119 else {
120 tpartners[iter_component-1]->get(iX,iY,iZ).template setField<descriptors::SOURCE>(
121 temp_source);
122 }
123 }
124 }
125 }
126 }
127 }
128 }
int get()
Get current device.
Definition device.hh:71
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
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(), olb::util::intersect(), and olb::util::pow().

+ 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: