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

#include <navierStokesAdvectionDiffusionCouplingPostProcessor2D.h>

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

Public Member Functions

 TotalEnthalpyPhaseChangeCouplingPostProcessor2D (int x0_, int x1_, int y0_, int y1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, 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, typename DYNAMICS>
class olb::TotalEnthalpyPhaseChangeCouplingPostProcessor2D< T, DESCRIPTOR, DYNAMICS >

Definition at line 37 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.h.

Constructor & Destructor Documentation

◆ TotalEnthalpyPhaseChangeCouplingPostProcessor2D()

template<typename T , typename DESCRIPTOR , typename DYNAMICS >
olb::TotalEnthalpyPhaseChangeCouplingPostProcessor2D< T, DESCRIPTOR, DYNAMICS >::TotalEnthalpyPhaseChangeCouplingPostProcessor2D ( int x0_,
int x1_,
int y0_,
int y1_,
T gravity_,
T T0_,
T deltaTemp_,
std::vector< T > dir_,
std::vector< BlockStructureD< 2 > * > partners_ )

Definition at line 40 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

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

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 42 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.h.

43 {
44 return 0;
45 }

◆ extent() [2/2]

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

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

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 46 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.h.

47 {
48 return 0;
49 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 109 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

111{
112 processSubDomain(blockLattice, x0, x1, y0, y1);
113}
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 , typename DYNAMICS >
void olb::TotalEnthalpyPhaseChangeCouplingPostProcessor2D< T, DESCRIPTOR, DYNAMICS >::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 67 of file navierStokesAdvectionDiffusionCouplingPostProcessor2D.hh.

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