OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR > Class Template Reference

#include <adsorptionCoupling3D.h>

+ Inheritance diagram for olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >:
+ Collaboration diagram for olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >:

Public Member Functions

 AdsorptionFullCouplingPostProcessor3D (int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int iC, std::vector< BlockStructureD< 3 > * > partners_, AdsorptionReaction< T, ADEDESCRIPTOR > *adsorptionReaction_, std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, NSDESCRIPTOR, ADEDESCRIPTOR > > > forces_)
 All in one adsorption coupling.
 
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, NSDESCRIPTOR > &blockLattice) override
 
void processSubDomain (BlockLattice< T, NSDESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
 
- Public Member Functions inherited from olb::PostProcessor3D< T, DESCRIPTOR >
 PostProcessor3D ()
 
virtual ~PostProcessor3D ()
 
virtual void process (BlockLattice< T, DESCRIPTOR > &blockLattice)=0
 Execute post-processing step.
 
virtual void processSubDomain (BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)=0
 Execute post-processing step on a sublattice.
 
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
 

Protected Attributes

std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, NSDESCRIPTOR, ADEDESCRIPTOR > > > forces
 
- Protected Attributes inherited from olb::PostProcessor3D< T, DESCRIPTOR >
int _priority
 

Detailed Description

template<typename T, typename NSDESCRIPTOR, typename ADEDESCRIPTOR>
class olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >

Definition at line 159 of file adsorptionCoupling3D.h.

Constructor & Destructor Documentation

◆ AdsorptionFullCouplingPostProcessor3D()

template<typename T , typename NSDESCRIPTOR , typename ADEDESCRIPTOR >
olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >::AdsorptionFullCouplingPostProcessor3D ( int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
int iC,
std::vector< BlockStructureD< 3 > * > partners_,
AdsorptionReaction< T, ADEDESCRIPTOR > * adsorptionReaction_,
std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, NSDESCRIPTOR, ADEDESCRIPTOR > > > forces_ )

All in one adsorption coupling.

Definition at line 35 of file adsorptionCoupling3D.hh.

40 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_), iC(iC_),
41 particleLattice(static_cast<BlockLattice<T, ADEDESCRIPTOR> *>(partners_[0])),
42 soluteLattice(static_cast<BlockLattice<T, ADEDESCRIPTOR> *>(partners_[1])),
43 loadingLattice(static_cast<BlockLattice<T, ADEDESCRIPTOR> *>(partners_[2])),
44 adsorptionReaction(adsorptionReaction_),
45 forces(forces_) {
46 this->getName() = "AdsorptionFullCouplingPostProcessor3D";
47 }
std::vector< std::reference_wrapper< AdvectionDiffusionForce3D< T, NSDESCRIPTOR, ADEDESCRIPTOR > > > forces
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 NSDESCRIPTOR , typename ADEDESCRIPTOR >
int olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 167 of file adsorptionCoupling3D.h.

167 {
168 return 0;
169 }

◆ extent() [2/2]

template<typename T , typename NSDESCRIPTOR , typename ADEDESCRIPTOR >
int olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >::extent ( int direction) const
inlineoverridevirtual

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

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 171 of file adsorptionCoupling3D.h.

171 {
172 return 0;
173 }

◆ process()

template<typename T , typename NSDESCRIPTOR , typename ADEDESCRIPTOR >
void olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >::process ( BlockLattice< T, NSDESCRIPTOR > & blockLattice)
override

Definition at line 50 of file adsorptionCoupling3D.hh.

50 {
51 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
52 }
void processSubDomain(BlockLattice< T, NSDESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)

◆ processSubDomain()

template<typename T , typename NSDESCRIPTOR , typename ADEDESCRIPTOR >
void olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >::processSubDomain ( BlockLattice< T, NSDESCRIPTOR > & blockLattice,
int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )

Definition at line 55 of file adsorptionCoupling3D.hh.

56 {
57
58 int newX0, newX1, newY0, newY1, newZ0, newZ1;
60 x0, x1, y0, y1, z0, z1,
61 x0_, x1_, y0_, y1_, z0_, z1_,
62 newX0, newX1, newY0, newY1, newZ0, newZ1)) {
63 for (int iX = newX0; iX <= newX1; ++iX) {
64 for (int iY = newY0; iY <= newY1; ++iY) {
65 for (int iZ = newZ0; iZ <= newZ1; ++iZ) {
66 //computation of particle velocity for particle and load lattices
67 auto vel = blockLattice.get(iX, iY, iZ).template getField<descriptors::VELOCITY>();
68 T forceValue[3] = {0.,0.,0.};
69 if (forces.begin() != forces.end()) {
70 auto velXp = blockLattice.get(iX+1, iY, iZ).template getField<descriptors::VELOCITY>();
71 auto velXn = blockLattice.get(iX-1, iY, iZ).template getField<descriptors::VELOCITY>();
72 auto velYp = blockLattice.get(iX, iY+1, iZ).template getField<descriptors::VELOCITY>();
73 auto velYn = blockLattice.get(iX, iY-1, iZ).template getField<descriptors::VELOCITY>();
74 auto velZp = blockLattice.get(iX, iY, iZ+1).template getField<descriptors::VELOCITY>();
75 auto velZn = blockLattice.get(iX, iY, iZ-1).template getField<descriptors::VELOCITY>();
76 T velGrad[3] = {0., 0., 0.};
77 velGrad[0] = 0.5*(vel[0]*(velXp[0] - velXn[0]) + vel[1]*(velYp[0] - velYn[0]) + vel[2]*(velZp[0] - velZn[0]));
78 velGrad[1] = 0.5*(vel[0]*(velXp[1] - velXn[1]) + vel[1]*(velYp[1] - velYn[1]) + vel[2]*(velZp[1] - velZn[1]));
79 velGrad[2] = 0.5*(vel[0]*(velXp[2] - velXn[2]) + vel[1]*(velYp[2] - velYn[2]) + vel[2]*(velZp[2] - velZn[2]));
80
81 int latticeR[4] = {iC, iX, iY, iZ};
82 auto nsCell = blockLattice.get(iX, iY, iZ);
83 auto adCell = particleLattice->get(iX, iY, iZ);
84 for (AdvectionDiffusionForce3D<T, NSDESCRIPTOR, ADEDESCRIPTOR>& f : forces) {
85 f.applyForce(forceValue, &nsCell, &adCell, vel.data(), latticeR);
86 }
87
88 // compute new particle velocity under action of forces
89 Vector<T,ADEDESCRIPTOR::d> newVel;
90 for (int i=0; i < ADEDESCRIPTOR::d; i++) {
91 newVel[i] = vel[i] + forceValue[i] - velGrad[i];
92 }
93 particleLattice->get(iX, iY, iZ).template setField<descriptors::VELOCITY>(newVel);
94 loadingLattice->get(iX, iY, iZ).template setField<descriptors::VELOCITY>(newVel);
95 }
96 else { // set particle velocity to the carrier fluid velocity
97 particleLattice->get(iX, iY, iZ).template setField<descriptors::VELOCITY>(vel);
98 loadingLattice->get(iX, iY, iZ).template setField<descriptors::VELOCITY>(vel);
99 }
100
101 //setting of the solute velocity to the carrier fluid velocity
102 soluteLattice->get(iX, iY, iZ).template setField<descriptors::VELOCITY>(vel);
103
104 //computation of the adsorption source terms for solute and load lattices
105 T soluteConcentration = soluteLattice->get(iX, iY, iZ).computeRho();
106 T particleConcentration = particleLattice->get(iX, iY, iZ).computeRho();
107 T particleLoading = loadingLattice->get(iX, iY, iZ).computeRho();
108 Vector<T, 2> reactionRates = adsorptionReaction->getReactionRate(soluteConcentration, particleLoading, particleConcentration);
109 loadingLattice->get(iX, iY, iZ).template setField<descriptors::SOURCE>(reactionRates[1]);
110 soluteLattice->get(iX, iY, iZ).template setField<descriptors::SOURCE>(-reactionRates[0]);
111 }
112 }
113 }
114 }
115}
Vector< T, 2 > getReactionRate(T soluteConcentration, T particleLoading, T particleConcentration)
Calculates reaction rate in lattice units.
Cell< T, DESCRIPTOR > get(CellID iCell)
Get Cell interface for index iCell.
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:

Member Data Documentation

◆ forces

template<typename T , typename NSDESCRIPTOR , typename ADEDESCRIPTOR >
std::vector<std::reference_wrapper<AdvectionDiffusionForce3D<T, NSDESCRIPTOR, ADEDESCRIPTOR> > > olb::AdsorptionFullCouplingPostProcessor3D< T, NSDESCRIPTOR, ADEDESCRIPTOR >::forces
protected

Definition at line 178 of file adsorptionCoupling3D.h.


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