OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
olb::SmagorinskyBoussinesqCoupling Struct Reference

AD coupling with Boussinesq bouancy for Smagorinsky-LES. More...

#include <navierStokesAdvectionDiffusionCoupling.h>

+ Collaboration diagram for olb::SmagorinskyBoussinesqCoupling:

Classes

struct  FORCE_PREFACTOR
 
struct  OMEGA_ADE
 
struct  OMEGA_NSE
 
struct  PR_TURB
 
struct  SMAGORINSKY_PREFACTOR
 
struct  T0
 

Public Types

using parameters = meta::list<FORCE_PREFACTOR,SMAGORINSKY_PREFACTOR,PR_TURB,T0,OMEGA_NSE,OMEGA_ADE>
 

Public Member Functions

template<typename CELLS , typename PARAMETERS >
void apply (CELLS &cells, PARAMETERS &parameters) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCellWithParameters
 

Detailed Description

AD coupling with Boussinesq bouancy for Smagorinsky-LES.

Definition at line 143 of file navierStokesAdvectionDiffusionCoupling.h.

Member Typedef Documentation

◆ parameters

Definition at line 153 of file navierStokesAdvectionDiffusionCoupling.h.

Member Function Documentation

◆ apply()

template<typename CELLS , typename PARAMETERS >
void olb::SmagorinskyBoussinesqCoupling::apply ( CELLS & cells,
PARAMETERS & parameters )
inline

Molecular realaxation time

Turbulent realaxation time

Effective realaxation time

Definition at line 156 of file navierStokesAdvectionDiffusionCoupling.h.

157 {
158 using V = typename CELLS::template value_t<names::NavierStokes>::value_t;
159 using DESCRIPTOR = typename CELLS::template value_t<names::NavierStokes>::descriptor_t;
160 using DESCRIPTOR_ADE = typename CELLS::template value_t<names::Temperature>::descriptor_t;
161
162 auto& cellNSE = cells.template get<names::NavierStokes>();
163 auto& cellADE = cells.template get<names::Temperature>();
164
165 // computation of the bousinessq force
166 auto force = cellNSE.template getFieldPointer<descriptors::FORCE>();
167 auto forcePrefactor = parameters.template get<FORCE_PREFACTOR>();
168 V temperatureDifference = cellADE.computeRho() - parameters.template get<T0>();
169
170 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
171 force[iD] = forcePrefactor[iD] * temperatureDifference;
172 }
173
174 // Velocity coupling
175 auto u = cellADE.template getField<descriptors::VELOCITY>();
176 // tau coupling
177 auto tauNS = cellNSE.template getFieldPointer<descriptors::TAU_EFF>();
178 auto tauAD = cellADE.template getFieldPointer<descriptors::TAU_EFF>();
179
180 V rho, pi[util::TensorVal<DESCRIPTOR>::n] { };
181 cellNSE.computeAllMomenta(rho, u.data(), pi);
182 cellADE.template setField<descriptors::VELOCITY>(u);
183 V PiNeqNormSqr = pi[0]*pi[0] + 2.0*pi[1]*pi[1] + pi[2]*pi[2];
184 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
185 PiNeqNormSqr += pi[2]*pi[2] + pi[3]*pi[3] + 2*pi[4]*pi[4] +pi[5]*pi[5];
186 }
187 V PiNeqNorm = util::sqrt(PiNeqNormSqr);
189 V tau_mol_NS = V{1} / parameters.template get<OMEGA_NSE>();
190 V tau_mol_AD = V{1} / parameters.template get<OMEGA_ADE>();
192 V smagoPrefactor = parameters.template get<SMAGORINSKY_PREFACTOR>();
193 V tau_turb_NS = V{0.5}*(util::sqrt(tau_mol_NS*tau_mol_NS + smagoPrefactor/rho*PiNeqNorm) - tau_mol_NS);
195 tauNS[0] = tau_mol_NS+tau_turb_NS;
196
197 V prTurb = parameters.template get<PR_TURB>();
198 V tauTurbADPrefactor = descriptors::invCs2<V,DESCRIPTOR_ADE>() / descriptors::invCs2<V,DESCRIPTOR>() / prTurb;
199 V tau_turb_AD = tau_turb_NS * tauTurbADPrefactor;
200 tauAD[0] = tau_mol_AD+tau_turb_AD;
201 }
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
meta::list< FORCE_PREFACTOR, SMAGORINSKY_PREFACTOR, PR_TURB, T0, OMEGA_NSE, OMEGA_ADE > parameters
static constexpr int n
result stored in n
Definition util.h:211

References olb::util::sqrt().

+ Here is the call graph for this function:

Member Data Documentation

◆ scope

constexpr OperatorScope olb::SmagorinskyBoussinesqCoupling::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 144 of file navierStokesAdvectionDiffusionCoupling.h.


The documentation for this struct was generated from the following file: