OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
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
 

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 138 of file freeSurfacePostProcessor2D.h.

Member Function Documentation

◆ apply()

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

@hint moved flag removal to processor 1 without any negative effects

@hint moved flag removal to processor 1 without any negative effects

Definition at line 425 of file freeSurfacePostProcessor2D.hh.

425 {
426
427 using namespace olb::FreeSurface;
428
429 /* Convert flagged cells to appropriate cell types */
430 FreeSurface::Flags flags = static_cast<FreeSurface::Flags>(cell.template getField<FreeSurface::CELL_FLAGS>());
431
432 switch(flags){
434 {
437 cell.template setField<FreeSurface::EPSILON>( 1. );
438 T mass_tmp = cell.template getField<FreeSurface::MASS>();
439 mass_tmp += cell.template getField<FreeSurface::TEMP_MASS_EXCHANGE>()[0];
440 cell.template setField<FreeSurface::MASS>(mass_tmp);
441
442 }
443 break;
445 {
448 cell.template setField<FreeSurface::EPSILON>( 0. );
449 T mass_tmp = cell.template getField<FreeSurface::MASS>();
450 mass_tmp += cell.template getField<FreeSurface::TEMP_MASS_EXCHANGE>()[0];
451 cell.template setField<FreeSurface::MASS>(mass_tmp);
452
453 }
454 break;
456 {
458 }
459 break;
460 default:
461 break;
462 }
463
464 FreeSurface::Type type = static_cast<FreeSurface::Type>(cell.template getField<FreeSurface::CELL_TYPE>());
465
466 /* Collection of mass excess in a pulling step */
467 switch(type){
469 {
470 T collected_excess = 0.;
471 for(int iPop = 1; iPop < DESCRIPTOR::q; ++iPop){
472 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
473 descriptors::c<DESCRIPTOR>(iPop,1)});
474 auto tempMassExchange = cellC.template getFieldPointer<FreeSurface::TEMP_MASS_EXCHANGE>();
475
476 if (hasCellFlags(cellC,
479 int iPop_op = descriptors::opposite<DESCRIPTOR>(iPop);
480 collected_excess += tempMassExchange[iPop_op];
481 }
482 }
483
484 T mass_tmp = cell.template getField<FreeSurface::MASS>();
485
486 mass_tmp += collected_excess;
487 T rho;
488 T u_tmp[DESCRIPTOR::d];
489 cell.computeRhoU(rho, u_tmp);
490
491 Vector<T,DESCRIPTOR::d> u_vel{u_tmp[0], u_tmp[1]};
492
493 cell.template setField<FreeSurface::EPSILON>( mass_tmp / rho );
494 cell.template setField<FreeSurface::MASS>(mass_tmp);
495 cell.template setField<FreeSurface::PREVIOUS_VELOCITY>(u_vel);
496 }
497 break;
499 {
500 T collected_excess = 0.;
501
502 for(int iPop = 1; iPop < DESCRIPTOR::q; ++iPop){
503 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
504 descriptors::c<DESCRIPTOR>(iPop,1)});
505 auto tempMassExchange = cellC.template getFieldPointer<FreeSurface::TEMP_MASS_EXCHANGE>();
506 if (hasCellFlags(cellC,
509 int iPop_op = descriptors::opposite<DESCRIPTOR>(iPop);
510 collected_excess += tempMassExchange[iPop_op];
511 }
512 }
513
514 T mass_tmp = cell.template getField<FreeSurface::MASS>();
515 mass_tmp += collected_excess;
516 cell.template setField<FreeSurface::MASS>(mass_tmp);
517 }
518 break;
519 default:
520 break;
521 }
522}
Plain old scalar vector.
Definition vector.h:47
void setCellType(CELL &cell, const FreeSurface::Type &type)
bool hasCellFlags(CELL &cell, const FreeSurface::Flags &flags)

References olb::FreeSurface::Fluid, olb::FreeSurface::Gas, olb::FreeSurface::Interface, olb::FreeSurface::NewInterface, olb::FreeSurface::ToFluid, and olb::FreeSurface::ToGas.

◆ getPriority()

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

Definition at line 142 of file freeSurfacePostProcessor2D.h.

142 {
143 return 7;
144 }

Member Data Documentation

◆ scope

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

Definition at line 140 of file freeSurfacePostProcessor2D.h.


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