395 {
396 using V = typename CELL::template value_t<names::NavierStokes>::value_t;
397 using DESCRIPTOR = typename CELL::template value_t<names::NavierStokes>::descriptor_t;
398
399 auto& cellNS = cells.template get<names::NavierStokes>();
400 auto& cellAC = cells.template get<names::Component1>();
401
403 auto sigma =
parameters.template get<SIGMA>();
405 auto rho = cellNS.template getField<descriptors::RHO>();
406 auto nablaRho = cellNS.template getField<descriptors::NABLARHO>();
407
408 V phi = cellAC.template getFieldComponent<descriptors::STATISTIC>(0);
409 auto cellAC_n1 = cellAC.neighbor({-
normal[0],-
normal[1]});
410 auto cellNS_n1 = cellNS.neighbor({-
normal[0],-
normal[1]});
411 V phi_n1 = cellAC_n1.template getFieldComponent<descriptors::STATISTIC>(0);
413 V laplacePhi = 0;
414
415 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
419 }
420 V laplacePhi_n1 = 0;
421 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
422 const V phi_i_n1 = cellAC_n1.neighbor(
descriptors::c<DESCRIPTOR>(iPop)).template getFieldComponent<descriptors::STATISTIC>(0);
424 }
425
426
427 V k = 1.5*sigma*w;
428 V beta = 12*sigma/w;
429 V mu = 4*beta*phi*(phi-1.)*(phi-0.5)-k*laplacePhi;
430 V mu_n1 = 4*beta*phi_n1*(phi_n1-1.)*(phi_n1-0.5)-k*laplacePhi_n1;
431
432 V u[DESCRIPTOR::d] {};
433
434 V rhoU = u[0]*nablaRho[0]+u[1]*nablaRho[1];
435 V p_n1 = cellNS_n1.computeRho();
436 V p_n2 = cellNS.neighbor({-2*
normal[0],-2*
normal[1]}).computeRho();
437 V p_old = cellNS.computeRho();
438 V p_out = (p_n1 + (mu+mu_n1)/2*(phi-phi_n1));
439
440 if (phi >= 0.95) {
441 p_out = 0;
442 }
443
444 cellNS.defineRho(p_out);
445 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
447 }
448 }
constexpr T invCs2() any_platform
constexpr T t(unsigned iPop, tag::CUM) any_platform
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Distribution< T > normal(T mean, T stddev)
Vector(T &&t, Ts &&... ts) -> Vector< std::remove_cvref_t< T >, 1+sizeof...(Ts)>
meta::list< SIGMA, W, NORMAL > parameters