OpenLB 1.7
Loading...
Searching...
No Matches
olb::SmagorinskyBoussinesqCouplingPostProcessor3D< T, DESCRIPTOR > Class Template Reference

#include <navierStokesAdvectionDiffusionCouplingPostProcessor3D.h>

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

Public Member Functions

 SmagorinskyBoussinesqCouplingPostProcessor3D (int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T gravity_, T T0_, T deltaTemp_, std::vector< T > dir_, T PrTurb_, T smagoPrefactor_, 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::SmagorinskyBoussinesqCouplingPostProcessor3D< T, DESCRIPTOR >

Definition at line 91 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

Constructor & Destructor Documentation

◆ SmagorinskyBoussinesqCouplingPostProcessor3D()

template<typename T , typename DESCRIPTOR >
olb::SmagorinskyBoussinesqCouplingPostProcessor3D< T, DESCRIPTOR >::SmagorinskyBoussinesqCouplingPostProcessor3D ( int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
T gravity_,
T T0_,
T deltaTemp_,
std::vector< T > dir_,
T PrTurb_,
T smagoPrefactor_,
std::vector< BlockStructureD< 3 > * > partners_ )

Definition at line 197 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

201 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_),
202 gravity(gravity_), T0(T0_), deltaTemp(deltaTemp_),
203 dir(dir_), PrTurb(PrTurb_), smagoPrefactor(smagoPrefactor_), partners(partners_)
204{
205 this->getName() = "SmagorinskyBoussinesqCouplingPostProcessor3D";
206 // we normalize the direction of force vector
207 T normDir = T();
208 for (unsigned iD = 0; iD < dir.size(); ++iD) {
209 normDir += dir[iD]*dir[iD];
210 }
211 normDir = util::sqrt(normDir);
212 for (unsigned iD = 0; iD < dir.size(); ++iD) {
213 dir[iD] /= normDir;
214 }
215
216 for (unsigned iD = 0; iD < dir.size(); ++iD) {
217 forcePrefactor[iD] = gravity * dir[iD];
218 }
219
221 tPartner = static_cast<BlockLattice<T,descriptors::D3Q7<descriptors::VELOCITY,descriptors::TAU_EFF>> *>(partners[0]);
222}
std::string & getName()
read and write access to name
constexpr T invCs2() any_platform
Definition functions.h:107
Expr sqrt(Expr x)
Definition expr.cpp:199

References olb::PostProcessor3D< T, DESCRIPTOR >::getName(), olb::descriptors::invCs2(), and olb::util::sqrt().

+ Here is the call graph for this function:

Member Function Documentation

◆ extent() [1/2]

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

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 96 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

97 {
98 return 0;
99 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::SmagorinskyBoussinesqCouplingPostProcessor3D< 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 100 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.h.

101 {
102 return 0;
103 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 283 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

285{
286 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
287}
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 >
void olb::SmagorinskyBoussinesqCouplingPostProcessor3D< T, DESCRIPTOR >::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.

Molecular realaxation time

Turbulent realaxation time

Effective realaxation time

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 226 of file navierStokesAdvectionDiffusionCouplingPostProcessor3D.hh.

229{
230
231 int newX0, newX1, newY0, newY1, newZ0, newZ1;
232 if ( util::intersect (
233 x0, x1, y0, y1, z0, z1,
234 x0_, x1_, y0_, y1_, z0_, z1_,
235 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
236
237 for (int iX=newX0; iX<=newX1; ++iX) {
238 for (int iY=newY0; iY<=newY1; ++iY) {
239 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
240
241 // computation of the bousinessq force
242 auto force = blockLattice.get(iX,iY,iZ).template getFieldPointer<descriptors::FORCE>();
243 T temperatureDifference = tPartner->get(iX,iY,iZ).computeRho() - T0;
244 for (unsigned iD = 0; iD < L::d; ++iD) {
245 force[iD] = forcePrefactor[iD] * temperatureDifference;
246 }
247
248 // Velocity coupling
249 auto u = tPartner->get(iX,iY,iZ).template getField<descriptors::VELOCITY>();
250
251 // tau coupling
252 auto tauNS = blockLattice.get(iX,iY,iZ).template getFieldPointer<descriptors::TAU_EFF>();
253 auto tauAD = tPartner->get(iX,iY,iZ).template getFieldPointer<descriptors::TAU_EFF>();
254
256 blockLattice.get(iX,iY,iZ).computeAllMomenta(rho, u.data(), pi);
257 tPartner->get(iX,iY,iZ).template setField<descriptors::VELOCITY>(u);
258 T PiNeqNormSqr = pi[0]*pi[0] + 2.0*pi[1]*pi[1] + pi[2]*pi[2];
260 PiNeqNormSqr += pi[2]*pi[2] + pi[3]*pi[3] + 2*pi[4]*pi[4] +pi[5]*pi[5];
261 }
262 T PiNeqNorm = util::sqrt(PiNeqNormSqr);
264 T tau_mol_NS = 1. / blockLattice.get(iX,iY,iZ).getDynamics()->getParameters(blockLattice).template getOrFallback<descriptors::OMEGA>(0);
265 T tau_mol_AD = 1. / tPartner->get(iX,iY,iZ).getDynamics()->getParameters(*tPartner).template getOrFallback<descriptors::OMEGA>(0);
267 T tau_turb_NS = 0.5*(util::sqrt(tau_mol_NS*tau_mol_NS + smagoPrefactor/rho*PiNeqNorm) - tau_mol_NS);
268 if (tau_turb_NS != tau_turb_NS) {
269 tau_turb_NS = 0.0;
270 }
272 tauNS[0] = tau_mol_NS+tau_turb_NS;
273
274 T tau_turb_AD = tau_turb_NS * tauTurbADPrefactor;
275 tauAD[0] = tau_mol_AD+tau_turb_AD;
276 }
277 }
278 }
279 }
280}
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:85
static constexpr int n
result stored in n
Definition util.h:217

References olb::util::intersect(), and olb::util::sqrt().

+ Here is the call graph for this function:

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