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

#include <navierStokesAdvectionDiffusionCouplingPostProcessor3D.h>

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

Public Member Functions

 TotalEnthalpyPhaseChangeCouplingPostProcessor3D (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, typename DYNAMICS>
class olb::TotalEnthalpyPhaseChangeCouplingPostProcessor3D< T, DESCRIPTOR, DYNAMICS >

Definition at line 41 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

Constructor & Destructor Documentation

◆ TotalEnthalpyPhaseChangeCouplingPostProcessor3D()

template<typename T , typename DESCRIPTOR , typename DYNAMICS >
olb::TotalEnthalpyPhaseChangeCouplingPostProcessor3D< T, DESCRIPTOR, DYNAMICS >::TotalEnthalpyPhaseChangeCouplingPostProcessor3D ( 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 43 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

47 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_),
48 gravity(gravity_), T0(T0_), deltaTemp(deltaTemp_),
49 dir(dir_), partners(partners_)
50{
51 this->getName() = "TotalEnthalpyPhaseChangeCouplingPostProcessor3D";
52 // we normalize the direction of force vector
53 T normDir = T();
54 for (unsigned iD = 0; iD < dir.size(); ++iD) {
55 normDir += dir[iD]*dir[iD];
56 }
57 normDir = util::sqrt(normDir);
58 for (unsigned iD = 0; iD < dir.size(); ++iD) {
59 dir[iD] /= normDir;
60 }
61
62 for (unsigned iD = 0; iD < dir.size(); ++iD) {
63 forcePrefactor[iD] = gravity * dir[iD];
64 }
65
66 tPartner = static_cast<BlockLattice<T,descriptors::D3Q7<descriptors::VELOCITY,descriptors::TEMPERATURE>> *>(partners[0]);
67}
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 , typename DYNAMICS >
int olb::TotalEnthalpyPhaseChangeCouplingPostProcessor3D< T, DESCRIPTOR, DYNAMICS >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 46 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

47 {
48 return 1;
49 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR , typename DYNAMICS >
int olb::TotalEnthalpyPhaseChangeCouplingPostProcessor3D< T, DESCRIPTOR, DYNAMICS >::extent ( int direction) const
inlineoverridevirtual

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

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 50 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

51 {
52 return 1;
53 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 114 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

116{
117 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
118}
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 , typename DYNAMICS >
void olb::TotalEnthalpyPhaseChangeCouplingPostProcessor3D< T, DESCRIPTOR, DYNAMICS >::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 70 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

73{
74
75 int newX0, newX1, newY0, newY1, newZ0, newZ1;
76 if ( util::intersect (
77 x0, x1, y0, y1, z0, z1,
78 x0_, x1_, y0_, y1_, z0_, z1_,
79 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
80 auto* dynamics = static_cast<DYNAMICS*>(tPartner->template getDynamics<DYNAMICS>());
81 auto& parameters = static_cast<ParametersOfDynamicsD<DYNAMICS>&>(
82 tPartner->template getData<OperatorParameters<DYNAMICS>>());
83
84 for (int iX=newX0; iX<=newX1; ++iX) {
85 for (int iY=newY0; iY<=newY1; ++iY) {
86 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
87 auto cell = blockLattice.get(iX,iY,iZ);
88 auto partnerCell = tPartner->get(iX,iY,iZ);
89
90 T enthalpy = partnerCell.computeRho();
91
92 cell.template setField<descriptors::POROSITY>(
93 dynamics->template computeLiquidFraction<T>(parameters, enthalpy));
94 auto temperature = partnerCell.template getFieldPointer<descriptors::TEMPERATURE>();
95 temperature[0] = dynamics->template computeTemperature<T>(parameters, enthalpy);
96
97 // computation of the bousinessq force
98 auto force = blockLattice.get(iX,iY,iZ).template getFieldPointer<descriptors::FORCE>();
99 T temperatureDifference = temperature[0] - T0;
100 for (unsigned iD = 0; iD < L::d; ++iD) {
101 force[iD] = forcePrefactor[iD] * temperatureDifference;
102 }
103 // Velocity coupling
104 FieldD<T,DESCRIPTOR,descriptors::VELOCITY> u;
105 blockLattice.get(iX,iY,iZ).computeU(u.data());
106 tPartner->get(iX,iY,iZ).template setField<descriptors::VELOCITY>(u);
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::Vector< T, D >::data(), 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: