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

Free Surface Processor 7 Finishes up left over cell conversions and prepares the state for the next simulation step. More...

#include <freeSurfacePostProcessor2D.h>

+ Collaboration diagram for olb::FreeSurfaceFinalizeConversionPostProcessor2D< T, DESCRIPTOR >:

Public Member Functions

int getPriority () const
 
template<typename CELL >
void apply (CELL &cell) any_platform
 Free Surface Processor 7: Finalize Conversion.
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCell
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::FreeSurfaceFinalizeConversionPostProcessor2D< T, DESCRIPTOR >

Free Surface Processor 7 Finishes up left over cell conversions and prepares the state for the next simulation step.

Definition at line 146 of file freeSurfacePostProcessor2D.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR >
template<typename CELL >
void olb::FreeSurfaceFinalizeConversionPostProcessor2D< T, DESCRIPTOR >::apply ( CELL & cell)

Free Surface Processor 7: Finalize Conversion.

Definition at line 481 of file freeSurfacePostProcessor2D.hh.

481 {
482
483 using namespace olb::FreeSurface;
484
485 // Convert flagged cells to appropriate cell types
488 cell.template setField<FreeSurface::EPSILON>(T(1));
489 }
490 else if (hasCellFlags(cell, FreeSurface::Flags::ToGas)) {
492 cell.template setField<FreeSurface::EPSILON>(T(0));
493 }
496 }
497 else {
498 // if (hasCellFlags(cell, FreeSurface::Flags::None) == true),
499 // no further action is needed, as no conversion is triggered.
500 }
501
502 // Mass excess is distributed to old and new interface cells only,
503 // thus skip the non-interface cells.
505 return;
506 }
507
508 // Collection of mass excess in a pulling step for the interface cells
509 T collected_excess = T(0);
510 for (int iPop = 1; iPop < DESCRIPTOR::q; ++iPop) {
511 auto nbrCell = cell.neighbor(descriptors::c<DESCRIPTOR>(iPop));
512
514 auto tempMassExchange = nbrCell.template getField<FreeSurface::TEMP_MASS_EXCHANGE>();
515 collected_excess += tempMassExchange[descriptors::opposite<DESCRIPTOR>(iPop)];
516 }
517 }
518
519 T mass_tmp = cell.template getField<FreeSurface::MASS>();
520 mass_tmp += collected_excess;
521 T rho = T(0);
522 T u_tmp[DESCRIPTOR::d] = {T(0), T(0)};
523 cell.computeRhoU(rho, u_tmp);
524 Vector<T,DESCRIPTOR::d> u_vel{u_tmp[0], u_tmp[1]};
525 cell.template setField<FreeSurface::EPSILON>(mass_tmp / rho);
526 cell.template setField<FreeSurface::MASS>(mass_tmp);
527 cell.template setField<FreeSurface::PREVIOUS_VELOCITY>(u_vel);
528}
Plain old scalar vector.
bool isCellType(CELL &cell, const FreeSurface::Type &type)
bool hasCellFlags(CELL &cell, const FreeSurface::Flags &flags)
void setCellType(CELL &cell, const FreeSurface::Type &type)
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
constexpr int opposite(unsigned iPop) any_platform
Definition functions.h:95

References olb::descriptors::c(), olb::FreeSurface::Fluid, olb::FreeSurface::Gas, olb::FreeSurface::Interface, olb::FreeSurface::NewInterface, olb::descriptors::opposite(), olb::FreeSurface::ToFluid, and olb::FreeSurface::ToGas.

+ Here is the call graph for this function:

◆ getPriority()

template<typename T , typename DESCRIPTOR >
int olb::FreeSurfaceFinalizeConversionPostProcessor2D< T, DESCRIPTOR >::getPriority ( ) const
inline

Definition at line 150 of file freeSurfacePostProcessor2D.h.

150 {
151 return 6;
152 }

Member Data Documentation

◆ scope

template<typename T , typename DESCRIPTOR >
OperatorScope olb::FreeSurfaceFinalizeConversionPostProcessor2D< T, DESCRIPTOR >::scope = OperatorScope::PerCell
staticconstexpr

Definition at line 148 of file freeSurfacePostProcessor2D.h.


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