template<typename STRESS>
struct olb::momenta::MovingPorousStress< STRESS >
Definition at line 1331 of file elements.h.
template<typename STRESS >
template<typename TYPE , typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
Definition at line 1333 of file elements.h.
1334 {
1335 V uNew[DESCRIPTOR::d] { };
1336 const V porosity = cell.template getField<descriptors::POROSITY>();
1337 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
1338 uNew[iD] = u[iD] + V{0.5} * rho
1339 * (V{1} - porosity)
1340 * (cell.template getFieldComponent<descriptors::VELOCITY>(iD) - u[iD]);
1341 }
1342
1345
1346 int iPi = 0;
1347 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1348 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1349 forceTensor[iPi] = V{0.5} * rho * (uNew[iBeta] + uNew[iAlpha]);
1350 ++iPi;
1351 }
1352 }
1353
1354 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1355 pi[iPi] += forceTensor[iPi];
1356 }
1357 }
void compute(CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
static constexpr int n
result stored in n
References olb::momenta::MovingPorousStress< STRESS >::compute().